If you are working in a shared active directory environment
and has a shared folder that needs to be renamed once in a while.
But every time you want to rename there is always a user who
is using the folder and therefore, renaming the folder is denied.
How to rename the folder when the shared folder is always in
use?
Automation will come for the rescue in such a scenario.
How to automate renaming the folder?
Task scheduler and a simple batch file can do the task and a
life saver.
Here's how to do it:
Of course, disconnect all the open files. Users should
shutdown their computers when they went out of the office,
If they don't shutdown, force their disconnection by using
the command below:
openfiles /disconnect /o read/write
openfiles /disconnect /o no access
Then, rename the folder with the ren or rename command of
course.
Syntax is the good old fashioned source folder or path and
the new folder name.
If the batch file will be run directly on the server, then
the drive letter will do the job.
ren "D:\Work_Folder\D_Mix_Folder\Mix_Folder_1"
"Mix_Folder_1_Final"
If there are a quite a few folders to be renamed, then just
add it to the list.
Save the list of the text file to a batch file.
So, basically the whole batch file script will look like
this:
openfiles /disconnect /o read/write
openfiles /disconnect /o no access
ren "D:\Work_Folder\D_Mix_Folder\Mix_Folder_1"
"Mix_Folder_1_Final"
ren "D:\Work_Folder\D_Mix_Folder\Mix_Folder_2"
"Mix_Folder_2_Final"
.
.
.
List goes on.
Save the file as ".bat" or ".cmd" and
set a task scheduler at midnight or early in the morning to execute the task.
Cheers! Till next time.
================================
Free Android Apps:
Click on links below to find out more:
https://play.google.com/store/apps/details?id=chrisjoms.myexcelapplicationguide
Linux Android App cheat sheet:
Multiplication Table for early learnershttps://play.google.com/store/apps/details?id=com.TableMultiplication
Catholic Rosary Guide for Android:
Divine Mercy Chaplet Guide (A Powerful prayer):
Comments
Post a Comment