Question Locked

Map folder before logging in to machine (for backup purposes)

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi everyone. I would like to ask your technical expertise regarding my question. Here's the scenario:

Our Win2003 server (server A) has a scheduled backup (using Windows Scheduled Task) every night which is saved on a hard disk of different server (Server B). Server A also is configured to shutdown every night after the backup has ran. I need to map a shared folder in Server B automatically (without logging in to the machine) after booting so that the backup will run later that day. How can I do this? Please note that Server A's domain is different from Server B.

I have already done a script, as below, and saved it under the Startup folder of Server A. It is actually running problem is I need to login to the machine before it can work. I also tried putting this script on the GPO of Server A (Computer Config - Windows Settings - Startup Script), and checked that its running using gpresult. But when I check the network drives, the shared folder is not there. Is there a special permission I need to provide for the credential that I used in my batch file? What would be the correct way to do this? Please help.. Thanks!

Here's the script:

if exist Y: net use Y: /delete
net use y: \\10.1.70.28\DELLRoot_backup password /user:INOKSG\thery /persistent:no

7 replies

by normh3

If I understand correctly, you will need a script to create the share prior to mapping it. Mapping a non-existent share does not create one.

by kabooki29

Thanks for the info. I forgot to mentioned that the folder is already shared on the other machine. From the script that I provided, the sahre name is "DELLRoot_backup". Username and password is also included for authentication.

by wizard-09

Have you put a PAUSE in the bat file to ensure that it is running fine with the user name and password provided, also have you check that the user has the rights to backup to that drive / folder over the network?

Keep us informed as to your progress if you require further assistance.

If you think that any of the posts that have been made by all TR Members, have solved or contributed to solving the problem, please Mark them as Helpful so that others may benefit from the outcome.

by normh3

an easy thing to do. I thought you said when you went to look at the share, it wasn't there. This would indicate too me that it wasn't created.

by kabooki29

Sorry for replying just now, I just returned from holiday (Chinese New Year, Gong Xi Fa Cai!). Thanks for the response.

About the PAUSE, I haven't tried using this command but from the articles that I have read, it suspends the execution of the batch file until a key is pressed. I think this won't be applicable as there must be no user intervention when running the script. How about the sleep command? Would it be applicable?

Regarding the user rights, the account that I am using has rights to backup the server. I ran the same script after I logged in to the server and waited for the Scheduled Task to run, and it works perfectly. It's the automation of the script before login that I need to do.

by kabooki29

What I meant from saying that "the folder is already shared on the other machine" is that, the folder in Server B is already shared as "DELLRoot_backup". Problem is that when the script runs before I log in to Server A, the mapping of the shared folder (DELLRoot_backup) is not existing as a mapped network drive.

The shared folder is already existing but the folder mapping was not created.

This discussion is closed to new replies.