Jump to content

Recommended Posts

Posted

I have tried and tried, but I can not get this runwait command line to work.. I always have difficulty with quoted command lines... PLEASE HELP! THANK YOU SO VERY MUCH! Jim

$thedir = "c:\testdir"

runwait("C:\WINDOWS\SYSTEM32\XCOPY.EXE" & chr(34) & @MyDocumentsDir & CHR(34) & ' ' & chr(34) & $thedir & chr(34) & ' /c/s/a/exclude:\exclude.txt >c:\backup.txt')

Posted

How about this?

runwait('C:\Windows\System32\XCOPY.EXE "' & @MyDocumentsDir & '" "' & $thedir & '" /c/s/a/exclude:exclude.txt >c:backup.txt')

My UDFs and Tutorials:

  Reveal hidden contents

 

  • 2 weeks later...
Posted

Thanks for your help but

that did not work.. I did this - highlight the whole line (the part inside the parentheses) in Scite and then hit ALT-D which will give you a consolewrite line containing the data and the variables, so you can see exactly how it is going to look in the command line. Then I execute the lines and look at the console write command in the output box.. the part after "=" I copied that part and pasted into a dos window to try it...

It works in the dos window, but not in autoit script..

Here is the entire script with the line you gave me. Thanks for taking the time to look at this...

$thedir = "c:testdir"

runwait('C:\Windows\System32\XCOPY.EXE "' & @MyDocumentsDir & '" "' & $thedir & '" /c/s/a/exclude:exclude.txt >c:backup.txt')

ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : ''C:\Windows\System32\XCOPY.EXE "'' & @MyDocumentsDir & ''" "'' & $thedir & ''" /c/s/a/exclude:exclude.txt >c:backup.txt'' = ' & 'C:\Windows\System32\XCOPY.EXE "' & @MyDocumentsDir & '" "' & $thedir & '" /c/s/a/exclude:exclude.txt >c:backup.txt' & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console

Posted

I think the Debug line is not very reliable in this situation. It adds another set of quotes.

I copy the whole text to a ConsoleWrite statement:

$thedir = "c:\testdir"
ConsoleWrite('C:\WINDOWS\SYSTEM32\XCOPY.EXE "' & @MyDocumentsDir & '" "' & $thedir & '" /c/s/a/exclude:\exclude.txt >c:\backup.txt' & @CRLF)

My result looks like this:

C:\WINDOWS\SYSTEM32\XCOPY.EXE "C:\Users\xy\Documents" "c:\testdir" /c/s/a/exclude:\exclude.txt >c:\backup.txt

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

The debug line did produce the same result you had, but your method looks to be better...

this is it..

C:\Windows\System32\XCOPY.EXE "C:Documents and SettingsJim MihalskiMy Documents" "c:testdir" /c/s/a/exclude:exclude.txt >c:backup.txt

The problem is when that command is copied and pasted to a DOS window, the copy works just fine... BUT it does not work in the script.... nothing is copied. Can you try it in autoit? thanks

Posted

just figured out why it was not working.. I should have been using: runwait(@ComSpec & " /c " & etc. etc.

Now it works in the script...

Thanks so much for your help.... ;)

Posted

Glad you got the problem solved ;)

My UDFs and Tutorials:

  Reveal hidden contents

 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...