Guest scriptdau Posted April 23, 2004 Posted April 23, 2004 Hi Everybody, is it possible to get the output of a OS Command (for example DIR /S) into a MSGBOX without going over a temp. file? In OS Batch File I' am able to send the folder/file to a batch dir %%1 - is this also possible? Getting crazy to get this done For a hints and tips many thanks. Best regards Carlos
CyberSlug Posted April 23, 2004 Posted April 23, 2004 You cannot pipe or redirect to autoit. ....Wasn't someone working on getting this feature added? Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
scriptkitty Posted April 23, 2004 Posted April 23, 2004 I couldn't find a DirectTo.exe, so I made one. Here it is uncompiled If $cmdline[0]=1 Then If $cmdline[1]="/?" Then MsgBox(1,"Usage","DirectTo.exe file.exe [arguments]" & @crlf&"This copies output to clipboard.") EndIf If $cmdline[0]=0 Then MsgBox(1,"Usage","DirectTo.exe file.exe [arguments]" & @crlf&"This copies output to clipboard.") $out="" For $i= 1 To $cmdline[0] $out=$out & " " & $cmdline[$i] Next tooltip("Gathering Data",0,0) RunWait(@ComSpec & " /c " & $out & " >c:\tempme.txt",'',@SW_HIDE) $file=fileread("c:\tempme.txt",FileGetSize("c:\tempme.txt")) FileDelete("c:\tempme.txt") clipput($file) AutoIt3, the MACGYVER Pocket Knife for computers.
sl_alagappan Posted April 24, 2004 Posted April 24, 2004 I am not sure but the below link could be of some usefulness, I believehttp://www.codeproject.com/threads/redir.asp
scriptkitty Posted April 24, 2004 Posted April 24, 2004 DOH!! Now I remember. Try this. $x=getcmd("dir") func getcmd($command) ; copies output to clipboard, and returns output run(@comspec,"",@SW_HIDE) winwait(@comspec) controlsend(@comspec,'','',$command & "{enter}") controlsend(@comspec,'','',"!{space}es{enter}") winclose(@comspec) $out=clipget() return $out endfunc might have to adjust for time, but this might help a tad. AutoIt3, the MACGYVER Pocket Knife for computers.
Guest scriptdau Posted April 26, 2004 Posted April 26, 2004 (edited) Hi Everybody, first many thanks for your replies. What I' am fighting is to get the following batch converted into to autoit: set drive_info=%~d1 set path_info=%~p1 set file_info=%~n1 cd \ %drive_info% cd %path_info% @echo Files in Folder %drive_info%%path_info%%file_info%: @FOR /f %%a in ('DIR %drive_info%%path_info%%file_info% /s ^|FIND " File(s) " /c') do @FOR /f %%b in ('SET /a dummy^=%%a-1') do @(DIR %drive_info%%path_info%%file_info% /s/-c |FIND " File(s) "|MORE /e +%% pause Over the SendTo menu it is possible to add a shortcut of the batch-file. The org. question was, is it with autoit also possible to get a variable (for example) over the ms-explorer to process? Thanks for any reply. Regards Carlos Edited April 26, 2004 by scriptdau
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