Not sure why I can't get this to work. Running the output from the wscript.echo line on the command prompt works fine and outputs the text file. But doesn't within the script (doesn't create the text file). I'm pretty sure it has to do with the spaces in the path but since it works with copy and paste I think I have the quotes in the right place. Any ideas?
Thanks in advance.
It outputs this and I can copy and paste this on the command prompt and this works.
Thanks in advance.
Code:
Set objShell = WScript.CreateObject("WScript.Shell")
vSystemDrive = GetSystemDrive(".")
vWWNProgram = "%comspec% /c """ & vSystemDrive & ":\Program Files\SANsurferCLI\scli.exe"" -g>""" & vSystemDrive & ":\Program Files\Tools-Output\WWNoutput.txt"""
wscript.echo vWWNProgram
objShell.Run vWWNProgram, 0, True
It outputs this and I can copy and paste this on the command prompt and this works.
Code:
%comspec% /c "C:\Program Files\SANsurferCLI\scli.exe" -g>"C:\Program Files\Tools-Output\WWNoutput.txt"