d3mon Posted July 8, 2008 Share Posted July 8, 2008 Hello everybody, I try to write in cmd but when I make script with send("blabla") autoit write nothing, I've tried to put "WinSetOnTop()" but that write nothing, Although cmd has no control ID I can't put "ControlSetText".... Anyhelp ? No-life of autoit...what could be better ?LAST SCRIPTS WITH AUTO-IT : CLICK HERE Link to comment Share on other sites More sharing options...
James Posted July 8, 2008 Share Posted July 8, 2008 Why not just execute the command, with ShellExecute()? Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
d3mon Posted July 8, 2008 Author Share Posted July 8, 2008 Why not just execute the command, with ShellExecute()?Yes....Thanks lol No-life of autoit...what could be better ?LAST SCRIPTS WITH AUTO-IT : CLICK HERE Link to comment Share on other sites More sharing options...
d3mon Posted July 8, 2008 Author Share Posted July 8, 2008 What is the parameters for write in cmd ? No-life of autoit...what could be better ?LAST SCRIPTS WITH AUTO-IT : CLICK HERE Link to comment Share on other sites More sharing options...
Nevin Posted July 8, 2008 Share Posted July 8, 2008 (edited) I have no idea how ShellExecute() works, but I've used the cmd prompt for things with success. I needed to change some settings under the Control Panel, my script used the command prompt to call the windows I wanted. Maybe your cmd window wasn't active? Anyway, it's safer to use a ControlSend. Here's what I used in my script: Run("cmd.exe") winwaitactive("C:\WINDOWS\sys") ControlSend("C:\WINDOWS\sys","","","Write crap here!") ControlSend("C:\WINDOWS\sys","","","{ENTER}") Edited July 8, 2008 by Nevin Link to comment Share on other sites More sharing options...
tlman12 Posted July 8, 2008 Share Posted July 8, 2008 i use a simple RunWait() example script that kills and restarts the print spooler as admin RunAsSet("user", "domain or @computername", "password") RunWait('cmd /c net stop "print spooler"') RunWait('cmd /c net start "print spooler"') Sleep(500) RunWait('cmd /c net stop "print spooler"') RunWait('cmd /c net start "print spooler"') RunAsSet() Link to comment Share on other sites More sharing options...
Nevin Posted July 8, 2008 Share Posted July 8, 2008 Sexy. I didn't know you could do that. I also didn't know about the /c parameter. I'm confused about what it does. I thought it would close the window, but I just tried to put "cmd /c control" into Start Menu>Run and it opened the control panel as expected, but also opened a blank DOS window. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 8, 2008 Moderators Share Posted July 8, 2008 Sexy. I didn't know you could do that. I also didn't know about the /c parameter. I'm confused about what it does. I thought it would close the window, but I just tried to put "cmd /c control" into Start Menu>Run and it opened the control panel as expected, but also opened a blank DOS window./c = close /k = keep open You have to use the run method to see. RunWait('cmd /c '); will close right away MsgBox(0, 0, 0) RunWait('cmd /k '); will stay open until you close it Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
tlman12 Posted July 9, 2008 Share Posted July 9, 2008 Sexy. I didn't know you could do that. I also didn't know about the /c parameter. I'm confused about what it does. I thought it would close the window, but I just tried to put "cmd /c control" into Start Menu>Run and it opened the control panel as expected, but also opened a blank DOS window. /c = close /k = keep open You have to use the run method to see. RunWait('cmd /c '); will close right away MsgBox(0, 0, 0) RunWait('cmd /k '); will stay open until you close it Ya tha'ts basically all it does is just runs the command and closes so there's nothing left over when the script finishes Link to comment Share on other sites More sharing options...
d3mon Posted July 9, 2008 Author Share Posted July 9, 2008 Ya tha'ts basically all it does is just runs the command and closes so there's nothing left over when the script finishesYep, thanks for all answers ! No-life of autoit...what could be better ?LAST SCRIPTS WITH AUTO-IT : CLICK HERE 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