467,915 Members | 1,826 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,915 developers. It's quick & easy.

Trying to open .vbs script from another .vbs file

I have two vbs files/scripts that we keep separately and run separately. I'm writing a program that'll execute both scripts, but am having trouble. I get the error
(for line 5) that "The system cannot find the file specified." (code 80070002). I've checked the file path and it all looks good, I've even tried different locatiosn of the same file, but keep getting it. Is there something wrong in my script, or is it an error with my path name.

Expand|Select|Wrap|Line Numbers
  1. Option Explicit
  2.  
  3. Dim WshShell
  4. Set WshShell = CreateObject("WScript.Shell")
  5. WshShell.Run "C:\Moya\sfa transformation\codes\SFG Data Dic Latest\vbsFiles\Table.vbs", 7, True
  6. wscript.echo "C:\Moya\sfa transformation\codes\SFG Data Dic Latest\vbsFiles\Table.vbs"
  7.  
  8. WshShell.Run "C:\Moya\sfa transformation\codes\SFG Data Dic Latest\vbsFiles\vbsTableColsNew.vbs", 7, True
  9. wscript.echo "C:\Moya\sfa transformation\codes\SFG Data Dic Latest\vbsFiles\vbsTableColsNew.vbs"
  10.  
I've also tried using ScriptStart, but I keep getting error on line 3 that "ScriptStart" is an undefined variable..

Expand|Select|Wrap|Line Numbers
  1. Option Explicit
  2.  
  3. ScriptStart("C:\Moya\sfa transformation\codes\SFG Data Dic Latest\vbsFiles\Table.vbs")
  4.  
  5. ScriptStart("C:\Moya\sfa transformation\codes\SFG Data Dic Latest\vbsFiles\vbsTableColsNew.vbs")
  6.  
Help appreciated! I feel like I'm making silly mistakes, but if you can catch it, I'd be eternally grateful.
Jul 30 '10 #1
  • viewed: 2770
Share:
1 Reply
Kind of an old thread, but thought I'd try to answer, try putting wscript in front of the file location on line 5 e.g.:

"wscript c:\Moya\sfa..."

for the scriptstart I was running into the same problem, which is why I stumbled on this question. Was never able to find a solution.
Oct 19 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Andrew V. Romero | last post: by
8 posts views Thread by Juan Manuel AlegrŪa B. | last post: by
6 posts views Thread by Raistlin Majere | last post: by
6 posts views Thread by Moumen VB.NET 2003/2005 Developer | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.