polara Posted October 17, 2007 Share Posted October 17, 2007 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. Link to comment Share on other sites More sharing options...
martin Posted October 17, 2007 Share Posted October 17, 2007 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now