Jump to content

ran out of ideas - need help??


Recommended Posts

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')

Link to post
Share on other sites

How about this?

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

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2021-11-10 - Version 1.6.0.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (NEW 2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (NEW 2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to post
Share on other sites
  • 2 weeks later...

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

Link to post
Share on other sites

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:

Spoiler

UDFs:
Active Directory (NEW 2021-11-10 - Version 1.6.0.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (NEW 2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (NEW 2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to post
Share on other sites

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

Link to post
Share on other sites

Glad you got the problem solved ;)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2021-11-10 - Version 1.6.0.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (NEW 2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (NEW 2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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

    No registered users viewing this page.

×
×
  • Create New...