vbs文件将当前字典保存在txt文件中

时间:2014-07-27 06:07:40

标签: directory save

我希望批处理文件将当前字典保存在txt文件中 例如

     currentDirectory = left(WScript.ScriptFullName,(Len(WScript.ScriptFullName))-      (len(WScript.ScriptName)))
     WScript.Echo currentDirectory
     currentdirectory > currentDirectory.txt

1 个答案:

答案 0 :(得分:0)

如果需要批处理文件,则无需使用wscript。只需cd即可:

cd > c:\currentDir.txt

并使用cscriptVBS

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