Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


wshShell.run with a few quotes

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> wshShell.run with a few quotes
  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 >>
 wshShell.run with a few quotes - 9/22/2004 6:02:58 AM   
  bml104

 

Posts: 18
Score: 0
Joined: 3/9/2004
From:
Status: offline
im trying to run netsh command from wscript.shell
but it has a few "'s in it.

set wshShell= wscript.CreateObject("Wscript.Shell")
wshShell.run("netsh interface ip set address name="Local Area Connection" static 192.168.0.100 255.255.255.0 192.168.0.1 1")

This gives me the error of
Line 2
Char 52
Expected ')'
 
 
Post #: 1
 
 Re: wshShell.run with a few quotes - 9/22/2004 6:32:37 AM   
  mbouchard


Posts: 1863
Score: 14
Joined: 5/15/2003
From: USA
Status: offline
You will probably have to play with it but try adding some extra quotes.

wshShell.run("netsh interface ip set address name=""Local Area Connection"" static 192.168.0.100 255.255.255.0 192.168.0.1 1""")

(in reply to bml104)
 
 
Post #: 2
 
 Re: wshShell.run with a few quotes - 9/22/2004 8:21:56 AM   
  bml104

 

Posts: 18
Score: 0
Joined: 3/9/2004
From:
Status: offline
Thanks




Ipaddress = InputBox ("Input IP address", "BML lazy IP changer","192.168.1.1")




set wshShell= wscript.CreateObject("Wscript.Shell")
wshShell.run("netsh interface ip set address name= ""Local Area Connection"" static " & ipaddress & " 255.255.254.0 63.82.108.1 1")


whats a good way to encode it ? i found a .html encoder but what about .vbs

(in reply to bml104)
 
 
Post #: 3
 
 Re: wshShell.run with a few quotes - 9/23/2004 12:39:02 AM   
  mbouchard


Posts: 1863
Score: 14
Joined: 5/15/2003
From: USA
Status: offline
What do you mean by encode it?

(in reply to bml104)
 
 
Post #: 4
 
 Re: wshShell.run with a few quotes - 9/23/2004 1:57:36 AM   
  Bob Kelly

 

Posts: 4
Score: 0
Joined: 9/23/2004
From:
Status: offline
quote:
whats a good way to encode it ? i found a .html encoder but what about .vbs


If you mean to obfuscate the script, you might try the Script Packager feature of the Admin Script Editor: http://www.adminscripteditor.com

This tool creates a secure executable (EXE) package of your script (which can optionally include other support files and run with alternate user credentials (RunAs)).

(in reply to bml104)
 
 
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 >> wshShell.run with a few quotes 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