I am reading several lines from a text file, these are file paths to virtual servers that i need to get the status of.
i read the server.txt into an array then setting the variable cmdstr to = the dos command and line from the text file, however when i use the says file not found, this is because the file path has spaces
this is a example of one line from the servers.txt file
D:\Virtual Machines\BASE2000STD\win2000Serv.vmx
when i run my script i am using the Wscript.Echo to show me the variable cmdstr, which in this example wound be
Any ideas?? the only thing i can think of is to change the directory name, but that wound cause a lot of problems as there are 15 servers running in that dir
Set objTextFile = fso.OpenTextFile("c:\batch\server.txt", ForReading) Do Until objTextFile.AtEndOfStream strNextLine = objTextFile.Readline vmwareserver = Split(strNextLine , vbCrLf) For i = 0 to Ubound(vmwareserver) cmdstr = "cmd /c vmware-cmd "+vmwareserver(i)+" getstate >> c:\batch\status.txt"
uh... i wonder, why this works. i tried some usual escape sequences (like "executing \"cmd.exe /c dir\"" in a log file, tried """ also. after a while *g i read the documentation but i didn't find something useful. since then i always use the chr(34) to 'escape' the double quotes.