Mr.Furious 0 Posted March 31, 2005 I would like to get this converted to work in an AutoIt script: For /F "tokens=*" %%A in ('Dir /B /A:-D *.imc') Do (ShelExec %%A) I would also like it to work in all windows OS if possible as I heard this DOS command only works in NT systems. Share this post Link to post Share on other sites
CyberSlug 6 Posted March 31, 2005 Not everyone is familiar with DOS (batch-file) syntax.... If you tell us what the heck that line does, we could help you a lot easier Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Share this post Link to post Share on other sites
SvenP 0 Posted March 31, 2005 I would like to get this converted to work in an AutoIt script:For /F "tokens=*" %%A in ('Dir /B /A:-D *.imc') Do (ShelExec %%A)I would also like it to work in all windows OS if possible as I heard this DOS command only works in NT systems.<{POST_SNAPBACK}>I assume 'ShelExec' is an external program? Then try this: $search = FileFindFirstFile("*.imc") ; Check if the search was successful If $search = -1 Then MsgBox(0, "Error", "No files/directories matched *.imc") Exit EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop $attrib = FileGetAttrib($file) ; Skip directories If StringInStr($attrib, "D") Then ContinueLoop RunWait ("ShelExec "& $file) WEnd ; Close the search handle FileClose($search)The code above is NOT tested, could be full with typo's. It's just to give you an idea how you could do it.Regards,-Sven Share this post Link to post Share on other sites
Mr.Furious 0 Posted March 31, 2005 SvenP:ShelExec is an external program. A very simple utility to allow you to call the ShellExecute API from the command line.This is a replacement to the commonly used start.exe which does not work on NT because on NT "start" is implemented as an "Internal" command in cmd.exeIt can be found here http://www.naughter.com/shelexec.htmlThanks for the code I will give it a try.CyberSlug:What the line does is run an external program in this case ShellExec against everyfile in the folder which has an imc extension.ShellExec opens the file with the program which is registered with the windows shell.For /F "tokens=*" %%A in ('Dir /B /A:-D *.imc') Do (ShelExec %%A) Share this post Link to post Share on other sites
Mr.Furious 0 Posted March 31, 2005 Works like a charm thank you very much!! Share this post Link to post Share on other sites