/build/static/layout/Breadcrumb_cap_w.png

VB Script help

Hi Guys, I would really appriciate your help. I have a dos batch file that does this

cd folder\folder1\folder2\install.exe command line switches

cd ..

So it runs the exe from that folder then after runing goes one step back to parent folder. Can some one write a VBSCRIPT for it. Thanks


0 Comments   [ + ] Show comments

Answers (2)

Answer Summary:
Use the following script: Option Explicit Dim wshShell On Error Resume Next Set wshShell = WScript.CreateObject("WSCript.shell") If Err.Number <> 0 Then Wscript.Quit End If wshShell.Run "cd folder\folder1\folder2\install.exe" wshShell.Run "cd .." On Error Goto 0
Posted by: GAKIS 11 years ago
Fourth Degree Green Belt
2
 
 Option Explicit
Dim wshShell
On Error Resume Next
   Set wshShell = WScript.CreateObject("WSCript.shell")
   If Err.Number <> 0 Then
      Wscript.Quit
   End If
   wshShell.Run "cd folder\folder1\folder2\install.exe"
   wshShell.Run "cd .."
On Error Goto 0
 

Comments:
  • Both of these options worked, thankyou so much for your time and help. - sam42856 11 years ago
Posted by: psalwey 11 years ago
White Belt
0

GAKIS' answer should do the trick for you. If not,

Option Explicit
Dim wshShell
On Error Resume Next
   Set wshShell = WScript.CreateObject("WSCript.shell")
   If Err.Number <> 0 Then
      Wscript.Quit
   End If
   wshShell.Run  "cmd.exe /C cd folderpath\install.exe"

    wshShell.Run  "cmd.exe /C cd newfolderpath"

On Error Goto 0

may also do the trick. It does the same thing through cmd so you could tweak it to view the process if you wanted.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ