falcon1406 Posted November 20, 2014 Posted November 20, 2014 (edited) I write the code down below: #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> Send("#r") Sleep(1000) Send("cmd.exe{ENTER}") WinWait("C:\Windows\system32\cmd.exe") $cmdHandle = WinGetHandle("C:\Windows\system32\cmd.exe") _CLEANDIR($cmdHandle) Exit ;_CLEANDIR Func _CLEANDIR($cmdHandle) WinActivate($cmdHandle) $vDIR = _CMDREAD("C:\cygwin\bin\ls -1 c:\TEST | gawk '{print "del /Q c:'\'\TEST'\'\" $1 "'\'\*.*"}'") Local $i=0 For $vElement In $vDIR MsgBox($MB_SYSTEMMODAL, "", "For Loop: " & $vElement) Next ;MsgBox($MB_SYSTEMMODAL, "", "DIR List: " & $vDIR) Return EndFunc;==> _CLEANDIR ;_CMDREAD Func _CMDREAD($Command) Local $CMDRead MsgBox($MB_SYSTEMMODAL, "", "DIR List: " & $Command) $CMD = Run(@ComSpec & " /c " & $Command, @SystemDir, @SW_HIDE, $STDOUT_CHILD) While 1 $CMDRead &= StdoutRead($CMD) If @error Then ExitLoop WEnd Return $CMDRead EndFunc ;==>_CMDREAD I tried different quoting of the quotes in the _CMDREAD function call (line 17) but i can't compile it. I'am absolute new to AutoIt, search already the forum and google, but didn't find the answer to my problem. On command line it works fine: C:cygwinbinls -1 c:TEST | gawk '{print "del /Q c:''TEST''" $1 "''*.*"}' Maybe someone can help. Thanks in advance! Edited November 20, 2014 by falcon1406
alienclone Posted November 20, 2014 Posted November 20, 2014 it looks like the double quote before del should be single? If @error Then MsgBox(262192, "", @ComputerName & " slaps " & @UserName & " around a bit with a large trout!") EndIf "Yeah yeah yeah patience, how long will that take?" -Ed Gruberman REAL search results | SciTE4AutoIt3 Editor Full Version
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