- Dim Fso, a, oWshShell
- a = WScript.Arguments(0)
- Set oWshShell = CreateObject("WScript.Shell")
- MsgBox oWshShell.CurrentDirectory
- Set Fso = WScript.CreateObject("Scripting.FileSystemObject")
- Fso.GetFile("MyFile.txt").Name ="Hello.txt"
复制代码 第四行显示当前路径
可以看到加上了第二行会导致当前路径改变,导致找不到文件 |