Simple question about how to execute a command from a vb script 
Author Message
 Simple question about how to execute a command from a vb script

Hi All,
This is a really simple request, how from a vb script do I execute a normal
dos type command, I want to issue this command from a vb script.

rundll32 printui.dll,PrintUIEntry {etc etc etc}

So I can map a printer from a startup script, what do I need to put in front
of it to make it execute?

I know this is a simple question, but I am new to vb scripting :-)

Thanks in advance

Russ



Mon, 03 May 2004 19:58:52 GMT  
 Simple question about how to execute a command from a vb script
You can use the Run Method:

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "rundll32 printui.dll,PrintUIEntry {etc etc etc}", 1,True

--
torgeir

Quote:

> Hi All,
> This is a really simple request, how from a vb script do I execute a normal
> dos type command, I want to issue this command from a vb script.

> rundll32 printui.dll,PrintUIEntry {etc etc etc}

> So I can map a printer from a startup script, what do I need to put in front
> of it to make it execute?

> I know this is a simple question, but I am new to vb scripting :-)

> Thanks in advance

> Russ



Mon, 03 May 2004 20:24:44 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. New to VB Scripting / Simple Questions.

2. ADODB Command Execute question/problem...

3. A VB simple question....?

4. simple vb/access sql question

5. Simple Telnet From VB Question

6. How to execute a command line command from a *.HTA

7. executing command from within script

8. simple vb script problem

9. Using VB Script to execute an EXE file from a Web Browser

10. how to execute VB script

11. Executing a .exe file from within VB Script?

12. VB Script doesn't execute properly

 

 
Powered by phpBB® Forum Software