Similarly to the 7-zip silent install script, I also use the following script on my servers during their original build and patching:
I’m not sure if any of you have ever used pushd and popd, but they are pretty handy. The pushd will map the network share to a drive letter and automatically change to that letter. when finished running the command locally, popd will bring the session back to the original path, before the pushd was executed. I use these commands regularly, especially with my LCM import and export scripts.