Jump to content
Sign in to follow this  
speedi

need command line help

Recommended Posts

speedi

I always have difficulty with script lines like this one that does not work:

runwait("C:\Windows\System32\XXCOPY.EXE " & chr(34) & @DesktopDir & "*.*" & chr(34) & "C:Documents and SettingsJim MihalskiMy Documents" & "/M/C/Y/WV0")

This is intended to do what this dos window command would do...

xxcopy "C:Documents and SettingsJim MihalskiDesktop*.*" "C:Documents and SettingsJim MihalskiMy Documents" /M/C/Y/WV0

The intent is to copy all files with archive flag set in the desktop folder to the mydocuments folder...

I never seem to get the quote placement right... Can anyone tell me an easy rule or method to follow when constructing a line like the one above.... or how can I show the resulting line with scite or autoit...

Thank you very much...

Edited by speedi

Share this post


Link to post
Share on other sites
BrewManNH

What I do when I'm not 100% sure of where I put the quotes in a line like that is to 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. You can even copy that consolewrite to another script and just run it to see if you've done it right.

  • Like 1

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
Chimaera

I think this will be nearer, though im still not sure its right

runwait( @SystemDir & "XCOPY.EXE " & @DesktopDir & "*.*" & " " & @MyDocumentsDir & " /M /C /Y")

Example usage of Xcopy

xcopy C:*.mp3 E:mp3folder /S /I /C

Please be aware that Xcopy is depreciated in modern windows OS you will be better served using Robocopy which is present in all modern ones

Share this post


Link to post
Share on other sites
speedi

I tried the alt D console write, but it didn;t help me much... thanks anyway

Share this post


Link to post
Share on other sites
BrewManNH

I tried the alt D console write, but it didn;t help me much... thanks anyway

Why didn't it help you much, what was the output of the console write when you tested it?

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
speedi

Hey Brewman... I spoke to soon. I finally figured out what you were telling me to do and it worked... Thanks a whole lot...

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  

×