Jump to content
Sign in to follow this  

Problem with quotes

Recommended Posts


I write the code down below:

#include <AutoItConstants.au3>
#include <MsgBoxConstants.au3>

$cmdHandle = WinGetHandle("C:\Windows\system32\cmd.exe")



Func _CLEANDIR($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)
    ;MsgBox($MB_SYSTEMMODAL, "", "DIR List: " & $vDIR)
EndFunc;==> _CLEANDIR

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
   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!")

>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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.