Sign in to follow this  
Followers 0
polara

Rename folder command

2 posts in this topic

I have a script that creates a hidden folder named "My Documents" on a server if one doesn't exist:

If not exist "\\server\share\%username%\My Documents" (mkdir "\\server\share\%username%\My Documents")&(attrib +h "\\server\share\%username%\My Documents")

I would like to append/change this command to do the following:

  • If no folder named "My Documents" or "Documents" exists on the target, then create one named "Documents"
  • If a folder named "My Documents" does exist on the target, then rename the folder "My Documents" to "Documents"
  • The renaming has to be done without touching the contents of the folder.
The command is part of a Robocopy script I have been using with Win XP that backs up the typical WinXP user data locations to a server. I now have to make it work with Vista. I have rewritten my Robocopy script to capture the new data locations in Vista. Now I am hoping that renaming the target folders will prevent the need to re-backup many gigabytes of user data that has otherwise not changed since it was migrated to a Vista PC. Can anyone help me with this? Thanks.

Share this post


Link to post
Share on other sites



I have a script that creates a hidden folder named "My Documents" on a server if one doesn't exist:

If not exist "\\server\share\%username%\My Documents" (mkdir "\\server\share\%username%\My Documents")&(attrib +h "\\server\share\%username%\My Documents")

I would like to append/change this command to do the following:

  • If no folder named "My Documents" or "Documents" exists on the target, then create one named "Documents"
  • If a folder named "My Documents" does exist on the target, then rename the folder "My Documents" to "Documents"
  • The renaming has to be done without touching the contents of the folder.
The command is part of a Robocopy script I have been using with Win XP that backs up the typical WinXP user data locations to a server. I now have to make it work with Vista. I have rewritten my Robocopy script to capture the new data locations in Vista. Now I am hoping that renaming the target folders will prevent the need to re-backup many gigabytes of user data that has otherwise not changed since it was migrated to a Vista PC. Can anyone help me with this? Thanks.

To rename a folder use DirMove. If the target path is the same for the source and the destination then I think the folder is renamed rather than a copy made and the original deleted, but this needs to be confirmed!


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

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