Mr.Furious Posted March 31, 2005 Share 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. Link to comment Share on other sites More sharing options...
CyberSlug Posted March 31, 2005 Share 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! Link to comment Share on other sites More sharing options...
SvenP Posted March 31, 2005 Share 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 Link to comment Share on other sites More sharing options...
Mr.Furious Posted March 31, 2005 Author Share 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) Link to comment Share on other sites More sharing options...
Mr.Furious Posted March 31, 2005 Author Share Posted March 31, 2005 Works like a charm thank you very much!! 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