Jump to content

Recommended Posts

Posted (edited)

Hello guys :D

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 :D

Suggestion or example to how accomplish this task?

Many thanks

Edited by Terenz

Nothing is so strong as gentleness. Nothing is so gentle as real strength

 

Posted (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 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

WinPose - simultaneous fluent move and resize

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

Magic Math - a math puzzle

Demos:

Title Bar Menu - click the window title to pop-up a menu

 

Posted

you could run more dos commands in one line using the & as separator

have a look >here

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Posted

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()                             

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...