sahkeah
asked on
Creating backup script in VB script - The system cannot find the file specified 80070002
Hello,
I've looked at the various solutions provided on this site and none of them seem to work. I wonder if it is getting confused on the special characters within the directory name(s).
Code:
strCommand = """c:\Program Files (x86)\Ipswitch\WS_FTP Pro\ftpscrpt.exe -f c:\backupscript.scp"""
Set objShell = CreateObject("WScript.Shel l")
objShell.Run strCommand
I have tried:
strCommand = ""For simplicity, using smaller string within quotes""
strCommand = char(34) & ""For simplicity, using smaller string within quotes"" & char(34)
And different others, but to no avail, cannot get it going. Tried the double quotes i other ways and splitting the string also.
Here is the latest try, as thought the string was too long, so I broke it up:
strCommand1 = "c:\Program Files (x86)\"
strCommand2 = "Ipswitch\WS_FTP Pro\ftpscrpt.exe "
strCommand3 = " -f c:\backupscript.scp"
Set objShell = CreateObject("WScript.Shel l")
objShell.Run "" & strCommand1 & strCommand2 & strCommand3 & "", True
Thanks for your help
I've looked at the various solutions provided on this site and none of them seem to work. I wonder if it is getting confused on the special characters within the directory name(s).
Code:
strCommand = """c:\Program Files (x86)\Ipswitch\WS_FTP Pro\ftpscrpt.exe -f c:\backupscript.scp"""
Set objShell = CreateObject("WScript.Shel
objShell.Run strCommand
I have tried:
strCommand = ""For simplicity, using smaller string within quotes""
strCommand = char(34) & ""For simplicity, using smaller string within quotes"" & char(34)
And different others, but to no avail, cannot get it going. Tried the double quotes i other ways and splitting the string also.
Here is the latest try, as thought the string was too long, so I broke it up:
strCommand1 = "c:\Program Files (x86)\"
strCommand2 = "Ipswitch\WS_FTP Pro\ftpscrpt.exe "
strCommand3 = " -f c:\backupscript.scp"
Set objShell = CreateObject("WScript.Shel
objShell.Run "" & strCommand1 & strCommand2 & strCommand3 & "", True
Thanks for your help
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
One more quick question, can I apply the same solution to this string as well? Thanks.
strCommand = "C:\Program Files (x86)\R-Drive Image\r-driveimagecl.exe /a create -s=D: -a=" & strFilePath & strFile
strCommand = "C:\Program Files (x86)\R-Drive Image\r-driveimagecl.exe /a create -s=D: -a=" & strFilePath & strFile
Try this.
strCommand = """C:\Program Files (x86)\R-Drive Image\r-driveimagecl.exe""" & " /a create -s=D: -a=""" & strFilePath & strFile & """"
ASKER
'3 - WS_FTP Variables...
strCommand = """c:\Program Files (x86)\Ipswitch\WS_FTP Pro\ftpscrpt.exe""" & " -f " & """c:\backupscript.scp"""
'3 - Run WS_FTP via .scp script ...
Set objShell = CreateObject("WScript.Shel
objShell.Run strCommand, 1, True