我希望批处理文件将当前字典保存在txt文件中 例如
currentDirectory = left(WScript.ScriptFullName,(Len(WScript.ScriptFullName))- (len(WScript.ScriptName)))
WScript.Echo currentDirectory
currentdirectory > currentDirectory.txt
答案 0 :(得分:0)
如果需要批处理文件,则无需使用wscript。只需cd
即可:
cd > c:\currentDir.txt
并使用cscript
和VBS
:
currentDirectory = left(WScript.ScriptFullName,(Len(WScript.ScriptFullName))- (len(WScript.ScriptName)))
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.CreateTextFile("currentDirectory.txt")
objFile.WriteLine (currentDirectory)
objFile.Close