Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


VBSCript which will execute commands in start->run

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,27940
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> VBSCript which will execute commands in start->run
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 VBSCript which will execute commands in start->run - 11/11/2005 2:18:56 AM   
  xavior78

 

Posts: 9
Score: 0
Joined: 11/11/2005
Status: offline
Original message moved by Country73
Reason : VBScript question
Hi there,

I have a simple question, how can i create a script which will access start->run in windows?

Is there a method to access that window?

Thanks,

Scott
 
 
Post #: 1
 
 RE: VBSCript which will execute commands in start->run - 11/11/2005 5:44:49 AM   
  Country73


Posts: 733
Score: 10
Joined: 8/25/2004
From: USA
Status: offline
XAVIOR78,


What exactly are you wanting to accomplish by "accessing" the START -> RUN?

(in reply to xavior78)
 
 
Post #: 2
 
 RE: VBSCript which will execute commands in start->run - 11/11/2005 6:03:58 AM   
  Snipah


Posts: 1343
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
Welcome Xavior78,

The "run" dialog is nothing more than the command prompt with  GUI :)

You could use the objShell.Run "cmd /k dir c:"  to e.g. show the contents of the C-drive (the /k will make sure that the command box is not closed after runing the command)

_____________________________

For more information, please see the "Read me First" topic.

http://www.visualbasicscript.com

(in reply to xavior78)
 
 
Post #: 3
 
 RE: VBSCript which will execute commands in start->run - 11/11/2005 6:08:28 AM   
  xavior78

 

Posts: 9
Score: 0
Joined: 11/11/2005
Status: offline
In that particular case i wanted to map a printer for example when you go to run in xp and type in:

\\servername\hp-modelnumber

it will allow you to map the printer.  I have tried the script to map the network printer but i have permission issue.  In the place i work everyone can map a printer from run, so i figured by being able to create script wich will execute the same command from the run i will be able to avoid the permission issue.  Please notice script for mapping network printer works find for W2K but on XP which in my company is very restricted what is causing a problem. 

Is there a method which will allow me to access the start->run in XP?

Please advise.


(in reply to Country73)
 
 
Post #: 4
 
 RE: VBSCript which will execute commands in start->run - 11/11/2005 6:17:33 AM   
  Snipah


Posts: 1343
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
it could as simple as this:

Set objNetwork = CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection "\\servername\hp-modelnumber"


Here is an example where it also sets it as default:

Option Explicit
Dim objNetwork, strUNCPrinter
strUNCPrinter = "\\servername\hp-modelnumber"
Set objNetwork = CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection strUNCPrinter
objNetwork.SetDefaultPrinter strUNCPrinter

< Message edited by Snipah -- 11/11/2005 6:20:04 AM >


_____________________________

For more information, please see the "Read me First" topic.

http://www.visualbasicscript.com

(in reply to xavior78)
 
 
Post #: 5
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> VBSCript which will execute commands in start->run Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts