标题: [文本处理] vbscript 脚本中文件路径含有 %TEMP%, 如何转义成普通字符串 [打印本页]
作者: tiandyoin 时间: 2024-10-29 02:27 标题: vbscript 脚本中文件路径含有 %TEMP%, 如何转义成普通字符串
vbscript 脚本中文件路径含有 %TEMP%,但我不想 %temp% 求值,如何转义呢?- Set WshShell=CreateObject("WScript.Shell")
- strDesKtop=WshShell.SpecialFolders("DesKtop")
- Set oShellLink=WshShell.CreateShortcut(strDesKtop&"\8.3dos_short2long.lnk")
- sss="D:\Users\test\Desktop\a ;" & "%" & "TEMP" & "%"
- WScript.Echo sss
- oShellLink.TargetPath=sss
- oShellLink.WindowStyle=1
- oShellLink.Description="测试“创建桌面快捷方式”"
- oShellLink.Save
复制代码
作者: czjt1234 时间: 2024-10-29 08:25
- Set WshShell = CreateObject("WScript.Shell")
- strDesKtop = WshShell.SpecialFolders("DesKtop")
- Set oShellLink = WshShell.CreateShortcut(strDesKtop & "\8.3dos_short2long.lnk")
- sss = WshShell.ExpandEnvironmentStrings("%TEMP%")
- sss = "D:\Users\test\Desktop\a ;" & sss
- WScript.Echo sss
- oShellLink.TargetPath = sss
- oShellLink.WindowStyle = 1
- oShellLink.Description = "测试“创建桌面快捷方式”"
- oShellLink.Save()
复制代码
作者: tiandyoin 时间: 2024-10-29 10:27
回复 2# czjt1234
不看实际路径?我就是不想扩展,还给他扩展开来?
作者: czjt1234 时间: 2024-10-29 13:52
- Set WshShell=CreateObject("WScript.Shell")
- strDesKtop=WshShell.SpecialFolders("DesKtop")
- Set oShellLink=WshShell.CreateShortcut(strDesKtop&"\8.3dos_short2long.lnk")
- oShellLink.TargetPath="D:\Users\test\Desktop\a"
- oShellLink.Arguments="; %temp%"
- oShellLink.WindowStyle=1
- oShellLink.Description="测试“创建桌面快捷方式”"
- oShellLink.Save
复制代码
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |