Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Working with variables and CMD

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Working with variables and CMD
  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 >>
 Working with variables and CMD - 11/22/2004 9:33:50 AM   
  Protus

 

Posts: 23
Score: 0
Joined: 11/22/2004
From: Australia
Status: offline
alright. Here's my code, very simple.

Set WshShell = WScript.CreateObject("WScript.Shell")
username = inputBox("Who do you want to send to?")
message = inputBox("What is the message?")
WshShell.Run "CMD /C net send", username, message

I know thats not the correct syntax with the variables, so what is? Thanks

_____________________________

The one and only - Protus

My Site: http://www.protus.cjb.net
 
 
Post #: 1
 
 Re: Working with variables and CMD - 11/23/2004 1:03:27 AM   
  mbouchard


Posts: 1856
Score: 14
Joined: 5/15/2003
From: USA
Status: offline
you'll have to work out the syntax to the net send command, but this should work.

Set WshShell = WScript.CreateObject("WScript.Shell")
strusername = inputBox("Who do you want to send to?")
strmessage = inputBox("What is the message?")
WshShell.Run "CMD /K net send " & strusername & " " & strmessage ,1,true

(in reply to Protus)
 
 
Post #: 2
 
 Re: Working with variables and CMD - 11/23/2004 1:25:51 PM   
  Protus

 

Posts: 23
Score: 0
Joined: 11/22/2004
From: Australia
Status: offline
thanks mate. I thought it had something to do with &. BTW, whats with the 1, true?

thanks again

(in reply to Protus)
 
 
Post #: 3
 
 Re: Working with variables and CMD - 11/23/2004 11:47:14 PM   
  mbouchard


Posts: 1856
Score: 14
Joined: 5/15/2003
From: USA
Status: offline
1 - (intWindowStyle below) Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when displaying the window for the first time.

TRUE - See bWaitOnReturn below

quote:
intWindowStyle
Optional. Integer value indicating the appearance of the program's window. Note that not all programs make use of this information.
bWaitOnReturn
Optional. Boolean value indicating whether the script should wait for the program to finish executing before continuing to the next statement in your script. If set to true, script execution halts until the program finishes, and Run returns any error code returned by the program. If set to false (the default), the Run method returns immediately after starting the program, automatically returning 0 (not to be interpreted as an error code).

(in reply to Protus)
 
 
Post #: 4
 
 
 
  

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 >> Working with variables and CMD 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