Terenz Posted June 26, 2014 Share Posted June 26, 2014 (edited) Hello guys I'll try to be as clear as possible. I have a commandline interface ( .com ) and i need to automize that. Pratically now i'll do this way: 1) Open cmd 2) i'll write "mycommandline.com -indentify a:" 3) i'll write "mycommandline.com -indentify b:" 4) i'll write "mycommandline.com -indentify c:" and so on until Z I want to do that process with autoit BUT i want to spawn only ONE single CMD.exe process and not 26 times Suggestion or example to how accomplish this task? Many thanks Edited June 26, 2014 by Terenz Nothing is so strong as gentleness. Nothing is so gentle as real strength Link to comment Share on other sites More sharing options...
orbs Posted June 26, 2014 Share Posted June 26, 2014 (edited) write a single batch file with FOR loop A: to Z: use AutoIt RunWait() to call that batch file. here are some leads: http://superuser.com/questions/747009/dos-batch-script-to-iterate-through-ntfs-drives http://www.computing.net/answers/programming/batch-file-drive-loop/18537.html that batch file should also handle the result of your com app, if any, or deliver those to your AutoIt script. for example, redirect output for each drive to a text file, then let your AutoIt script process it. Edited June 26, 2014 by orbs Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Link to comment Share on other sites More sharing options...
Gianni Posted June 26, 2014 Share Posted June 26, 2014 you could run more dos commands in one line using the & as separator have a look >here Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
Exit Posted June 26, 2014 Share Posted June 26, 2014 Since I have no mycommandline.com, I used Dir command: $cmds = "(" For $i = 97 To 122 ; equals a to z $cmd = "dir " & Chr($i) & ":\ & " $cmds &= $cmd Next $cmds &= "echo. ) >" & @ScriptName & ".txt 2>&1" ConsoleWrite($cmds & @LF) RunWait('"' & @ComSpec & '" /c ' & $cmds, '', @SW_HIDE) ShellExecute(@ScriptName & ".txt") App: Au3toCmd UDF: _SingleScript() 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