What's the best way to copy a file from a network share to the local file system using a Windows batch file? Normally, I would use "net use *" but using this approach how can I get the drive letter?
To share files on your local network using the express settings, do the following: Open File Explorer. Navigate to the folder you want to share. Right-click the item, and select Properties. Folder Properties option. On the “Properties” window, click the Sharing tab. Click the Share button. Folder Sharing tab.
Once file sharing is configured on the source device, you can copy the files using Robocopy from the destination device. Open Start. Search for Command Prompt, right-click the top result, and select the Run as administrator option. Type the following command to copy the files over the network and press Enter:
Search for Command Prompt, right-click the top result, and select the Run as administrator option. Type the following command to copy the files over the network and press Enter: robocopy \source-device-ip[&path&]tosharefolder C:destination-device[&path&]tostore[&files&] /E /Z /ZB /R:5 /W:5 /TBD /NP /V /MT:16
To copy files between two computers, you must enable file sharing in the source device to allow Robocopy access to copy the files from the destination device. Use these steps to share files on your local network using the express settings: Open File Explorer on Windows 10.
Can you just use the full UNC path to the file?
copy \\myserver\myshare\myfolder\myfile.txt c:\myfiles
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With