billgatetlhai Posted May 23, 2009 Share Posted May 23, 2009 (edited) I want to run cmd.exe and do some works. I used this code: While 1 $m=GUIgetmsg() select case $m=$UF Run("C:\WINDOWS\system32\cmd.exe" ) Send(" dir c:\*.* /s/b/a-d > Filesc.doc {ENTER}") Send(" dir d: \*.* /s/b/a-d > Filesd.doc {ENTER}") MsgBox(4096, "Information", "Update successfull") ProcessClose("cmd.exe") Endselect Wend But it repeats twice, two cmd windows and two message boxes appeared! Who can help me? Edited May 23, 2009 by billgatetlhai Link to comment Share on other sites More sharing options...
CodyBarrett Posted May 23, 2009 Share Posted May 23, 2009 is $UF being called more than ONCE [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
billgatetlhai Posted May 23, 2009 Author Share Posted May 23, 2009 No. I only called $UF in that code. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 23, 2009 Moderators Share Posted May 23, 2009 (edited) No. I only called $UF in that code.You say No, but something you are doing is definately pressing it twice (might even be that Send() command), if you're getting two message boxes. To see, comment out the two send commands and see how many times you get it, and keep debugging that way until you find the culprit. Edit: Instead of your Run() + send commands... why not something like:RunWait(@ComSpec & " /c dir " & "C:\*.* /s /b /a-d > Files.doc", "", @SW_HIDE) RunWait(@ComSpec & " /c dir " & "D:\*.* /s /b /a-d > Files.doc", "", @SW_HIDE)? Edit2: Just curious, why in the world you'd want to list every file on each drive? Edited May 23, 2009 by SmOke_N 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...
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