Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Creating backup script in VB script - The system cannot find the file specified 80070002

Avatar of sahkeah
sahkeah asked on
VB Script
4 Comments1 Solution566 ViewsLast Modified:
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.Shell")

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.Shell")
objShell.Run "" & strCommand1 & strCommand2 & strCommand3 & "", True

Thanks for your help


ASKER CERTIFIED SOLUTION
Avatar of Aard Vark
Aard VarkFlag of Australia imageEngineer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answers