Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


VBS &command line switches

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> VBS &command line switches
  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 >>
 VBS &command line switches - 8/29/2001 5:14:27 PM   
  neho3

 

Posts: 1
Score: 0
Joined: 8/29/2001
From:
Status: offline
Hi there,

Can anyone tell me how to run a vbs script from the command line, and allow for swicthes in the code?
Is this possible and if so hwo is it done?
Thanks
Luis
 
 
Post #: 1
 
 Re: VBS &command line switches - 9/4/2001 7:35:07 AM   
  Pieman

 

Posts: 10
Score: 0
Joined: 8/16/2001
From: United Kingdom
Status: offline
The way i found to use command line switches was to use windows scripting files (.wsf) instead of .vbs

E.g.

If you had the following message.vbs file:

Dim MyMessage

MyMessage = MsgBox ( "Message", 0, "Message")

If you use message.wsf you cound have the following:

<package>

Dim MyMessage

<job id="Message1">
<script language="VBScript">

MyMessage = MsgBox ( "Message1", 0, "Message1")

</script>
</job>

<job id="Message2">
<script language="VBScript">

MyMessage = MsgBox ( "Message2", 0, "Message2")

</script>
</job>

And to call this type the following at the command line:

C:\message.wsf //job:message2

(Note: if you don't specify a job when calling the wsf the first job in the file is executed by default)

Hope this helps

(in reply to neho3)
 
 
Post #: 2
 
 
 
  

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 >> VBS &command line switches 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