Orbi WiFi 7 RBE973
Reply

Mapping drives from batch files and scripts

bcmit
Aspirant

Mapping drives from batch files and scripts

We are a small office with a ReadyNAS NV+ and Win7HP on the desktops. We have one Win7HP machine that acts as a "backup server" and backs up the ReadyNAS nightly.

Trying to script a quick & dirty addition to the backup script that would loop like this:

a. net use * /d /y
b. net use u: \\99.99.99.99\thisuser /u:thisuser password
c. run a sync util to sync u: to this user's storage space on Win7HP backup server
d. repeat

If I manually create the above in a batch file, everything works fine. (However, for many reasons the procedure must be automated and tied into our existing backup script.)

If the script creates the identical batch file and runs it, the first user is logged-in and synchronized, but all subsequent `net use` attempts fail.

Similarly, if the script attempts to map the drive through code, this message is received:

`Unrecognized network error #183`

The above error suggests that the network drive/path is unavailable -- but a net use command typed at the command line using identical parameters is successful.

The "backup server" is a Win7HP box with UAC disabled. When cmd prompt is launched, all windows are preceded by the word: `Administrator: ` -- however, when the script launches a command window to net use the drive, the cmd titlebar lacks that prefix.

Any thoughts / ideas?
Message 1 of 2
kossboss
Guide

Re: Mapping drives from batch files and scripts

Please show the entire batch script that fails just star out the passwords. Also is your nas in domain mode? Is your network in a domain?
Message 2 of 2
Top Contributors
Discussion stats
  • 1 reply
  • 979 views
  • 0 kudos
  • 2 in conversation
Announcements