how to execute a batch file into a VBS file 
Author Message
 how to execute a batch file into a VBS file

hi ,

I'm a beginner in VBS Code.

I m using a VBS file (call addusers.vbs) which read an Excel File
(Addusers.xls) to automate creation of NT users.
At the end of the VBS script, I would like to execute a .BAT file with
parameters but I don't know how ?

I tried to write source code below but it's not ok for the last line:

 user = oXL.activecell.Value
 passwd = oXL.activecell.offset(0, 1).Value
 set fso = wscript.CreateObject("Scripting.FileSystemObject")
 fso.OpenAsTextStream("d:\util.bat" + " " + user + " " + passwd)

Can Anybody help me to write the command line (source code) ?

thank you very much.

Please reply by mail.




Sat, 04 Jan 2003 03:00:00 GMT  
 how to execute a batch file into a VBS file

Hi Oliver !

Here ist example :

Option Explicit
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell") "
WshShell.Run "c:\abc.bat"
WScript.Quit

Martin Kellner



Quote:
> hi ,

> I'm a beginner in VBS Code.

> I m using a VBS file (call addusers.vbs) which read an Excel File
> (Addusers.xls) to automate creation of NT users.
> At the end of the VBS script, I would like to execute a .BAT file with
> parameters but I don't know how ?

> I tried to write source code below but it's not ok for the last line:

>  user = oXL.activecell.Value
>  passwd = oXL.activecell.offset(0, 1).Value
>  set fso = wscript.CreateObject("Scripting.FileSystemObject")
>  fso.OpenAsTextStream("d:\util.bat" + " " + user + " " + passwd)

> Can Anybody help me to write the command line (source code) ?

> thank you very much.

> Please reply by mail.





Sat, 04 Jan 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Executing a batch file from a VBS.

2. How do you pass parameters from a batch file to a VBS file

3. How to execute a batch file within a vbscript or activeX ftp object

4. Executing Batch Files

5. Executing batch files

6. Execute a batch file

7. Problems using WScript to execute a batch file

8. Executing a Batch File on another Computer

9. Executing batch files from Web Page

10. Help with SHELL to Execute Batch File

11. Help: hiding a DOS window when executing a DOS batch file

12. question on hiding a DOS window when executing a DOS batch file

 

 
Powered by phpBB® Forum Software