Sign in to follow this  
Followers 0
mrrlg

Trouble With @comspec

3 posts in this topic

I am trying to get to a DOS prompt in order to rename a folder and copy a new one from a network share. I use:

RunWait (@ComSpec & "/c rename C:\scripts old") and I get the following error

Error Unable to execute the external program. The system cannot find the path specified.

Where am I going wrong?

Share this post


Link to post
Share on other sites



well, in my own comspec hastle string, I learned you need a space in front of the /c

RunWait (@ComSpec & " /c rename C:\scripts old")

but why not just use the DirMove and DirCopy commands already built in?

From the help file:

DirMove

--------------------------------------------------------------------------------

Moves a directory and all sub-directories and files.

DirMove ( "source dir", "dest dir" [, flag])

Parameters

source dir Path of the source directory (with no trailing backslash). eg. "C:\Path1"

dest dir Path of the destination dir (with no trailing backslash). eg. "C:\Path_Copy"

flag [optional] this flag determines whether to overwrite files if they already exist:

0 = (default) do not overwrite existing files

1 = overwrite existing files

DirCopy

--------------------------------------------------------------------------------

Copies a directory and all sub-directories and files (Similar to xcopy).

DirCopy ( "source dir", "dest dir" [, flag])

Parameters

source dir Path of the source directory (with no trailing backslash). eg. "C:\Path1"

dest dir Path of the destination dir (with no trailing backslash). eg. "C:\Path_Copy"

flag [optional] this flag determines whether to overwrite file if they already exist:

0 = (default) do not overwrite existing files

1 = overwrite existing files


"I'm not even supposed to be here today!" -Dante (Hicks)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

RunWait (@ComSpec & "/c rename C:\scripts old")   

Where am I going wrong?

You need a SPACE before the /c

RunWait (@ComSpec & " /c rename C:\scripts old")
Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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