Sign in to follow this  
Followers 0
falcon1406

Problem with quotes

2 posts in this topic

#1 ·  Posted (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 by falcon1406

Share this post


Link to post
Share on other sites



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

>Exit code: 0

REAL search results

"Yeah yeah yeah, patience. How long will that take?"  -Ed Gruberman

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0