Mika Posted December 3, 2007 Share Posted December 3, 2007 Hi, i have this script, and it opens cmd, but i want it to open cmd as hidden, if u can do it, help me Run("cmd.exe") Sleep(500) Send("ipconfig /release{ENTER}") Sleep(800) Send("ipconfig /renew{ENTER}") Sleep(700) Send("exit{ENTER}") Link to comment Share on other sites More sharing options...
Nahuel Posted December 3, 2007 Share Posted December 3, 2007 From Help File:RemarksTo run DOS (console) commands, try Run(@ComSpec & " /c " & 'commandName', "", @SW_HIDE)So this would be your script.Run(@ComSpec & " /c ipconfig /release","",@SW_HIDE) Sleep(800) Run(@ComSpec & " /c ipconfig /renew","",@SW_HIDE) Link to comment Share on other sites More sharing options...
Mika Posted December 3, 2007 Author Share Posted December 3, 2007 This still wont get the whole console hidden, just the commands. :? Link to comment Share on other sites More sharing options...
Nahuel Posted December 3, 2007 Share Posted December 3, 2007 It does what your original script did a lot faster, hidden and better. So, what exactly do you want? Link to comment Share on other sites More sharing options...
Mika Posted December 3, 2007 Author Share Posted December 3, 2007 I wanted this and i got it thx for u m8 =) im happy now Run(@ComSpec & " /c " & 'cmd.exe', "", @SW_HIDE) Sleep(500) Run(@ComSpec & " /c ipconfig /release","",@SW_HIDE) Sleep(800) Run(@ComSpec & " /c ipconfig /renew","",@SW_HIDE) Sleep(800) Run(@ComSpec & " /c " & 'exit{ENTER}', "", @SW_HIDE) Link to comment Share on other sites More sharing options...
jvanegmond Posted December 3, 2007 Share Posted December 3, 2007 I wanted this and i got it thx for u m8 =) im happy nowRun(@ComSpec & " /c " & 'cmd.exe', "", @SW_HIDE) Sleep(500)Run(@ComSpec & " /c ipconfig /release","",@SW_HIDE)Sleep(800)Run(@ComSpec & " /c ipconfig /renew","",@SW_HIDE)Sleep(800)Run(@ComSpec & " /c " & 'exit{ENTER}', "", @SW_HIDE)What you basically do is this:cmd /c cmd ; Opening cmd using cmd?!? Remove this linecmd /c exit ; exit is not a valid command!!So what you have left:Run(@ComSpec & " /c ipconfig /release","",@SW_HIDE)Sleep(800)Run(@ComSpec & " /c ipconfig /renew","",@SW_HIDE) github.com/jvanegmond Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now