General discussion

Locked

Question about VBS

By mcampbell152 ·
I have a question concerning batch files and VBScripting. I have searched and searched the Internet including Microsoft. I am trying to either evoke a batch file from a vbscript or a vbscript from a batch file. I have used both execute and call to no avail. I would prefer to have just one file. I am trying to uninstall all versions of acrobat reader in a windows 2000 environment so that all workstation can be at 6.0.2. I can not seem to get one file to do an uninstall of all versions.
Thank you in advance
Michael

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Easy

by mozartiano123 In reply to Question about VBS

Hi guy, this is an easy and useful task.

Vbscript, trough the Windows Shell object, can execute exe programas. So, what?s the best way to run a bat file? I guess is CMD, so, let?s put it inside our script.

Dim objshell
'declarin variable

Set objShell = WScript.CreateObject("WScript.Shell")
'instatites variable

objShell.Run("cmd /C X: & yourbatch.bat")
'now I called the RUN method inside objShell class and opened the CMD executable. Thereafeter, I used de /C switch (you could use the /K either), to run the following command line inside cmd, and cmd will execute x: and follow with yourbatch.bat . If you want to learn more about the cmd parameters, open your cmd and type cmd /?, a list of parameters will be shown in your screen. Enjoy it.

Back to IT Employment Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums