Sometime you need to rename a file or a folder that does not reside on your sever. For example I run a scheduled task on one sever to rename the folder on another server so that I can automatically archive backups weekly. Batch files or command line operations do not support UNC paths like \\myserver\my_share without taking some steps first.
For this example I have a server called “server01″ is is running a script that will rename a folder called ‘Full’ that resides in a share called backup on a server called ‘server02′. First we map to the share, perform the operation, and then unmap the session. This method does not require a drive letter and thus works well and will never cause a DLA conflict.
Â
rename \\server02\backup\full \\server02\backup\archive
net use /delete \\server02\backup
Essentially the net use function allows you to then use the path in the script. Remember that if you do not have rights to the folder you are mapping to you may need to specify them in the first line.