Jump to content

Move or Rename Not Happening


 Share

Recommended Posts

I include the following line of syntax in my script but it never happens. The same worked last year under XP. I'm running Version 1.79 on a Win7 platform. The line is as follows:

RunWait(@ComSpec & ' /c move /Y "%UserProfile%\Application Data\Autodesk\MEP 2011\enu\Support\MEP.mnr" "MEP_mnr.original"',@MyDocumentsDir,@SW_HIDE)

I've tried using RENAME with the same result. Any help?

Link to comment
Share on other sites

Is the file locked? (Can you navigate to the actual file and copy/rename it through Windows Explorer?) I've noticed Windows 7 is a lot more picky about file locking than XP is.

Have you tried the FileMove command?

Edited by exodius
Link to comment
Share on other sites

I include the following line of syntax in my script but it never happens. The same worked last year under XP. I'm running Version 1.79 on a Win7 platform. The line is as follows:

RunWait(@ComSpec & ' /c move /Y "%UserProfile%\Application Data\Autodesk\MEP 2011\enu\Support\MEP.mnr" "MEP_mnr.original"',@MyDocumentsDir,@SW_HIDE)

I've tried using RENAME with the same result. Any help?

Yes, I've manually done the move and rename. Haven't tried the FileMove. I'll read about it...

Link to comment
Share on other sites

If you want to use FileMove for a rename, which the Help says to do, do you have to give the full path for the destination if it is the same or just give the new file name?

It's safer that way. If the working directory is set correctly you might get away with just the source and destination file names, but I would go for full path anyway to improve reliability.

;)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Well, the FileMove didn't work either. Here is what I entered:

FileMove("%UserProfile%\Application Data\Autodesk\MEP 2011\enu\Support\MEP.mnr", "%UserProfile%\Application Data\Autodesk\MEP 2011\enu\Support\MEP_mnr.original")

I must be missing something but it all seems syntactically (is that a word)correct...

Link to comment
Share on other sites

Did you set Opt("ExpandEnvStrings", 1)? Otherwise by default AutoIt does not recognize the environment variables like "%UserProfile%". You should use the included macros instead, like @AppDataDir (see help file):

FileMove(@AppDataDir & "\Autodesk\MEP 2011\enu\Support\MEP.mnr", @AppDataDir & "\Autodesk\MEP 2011\enu\Support\MEP_mnr.original")

;)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
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
 Share

  • Recently Browsing   0 members

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