Get a batch file to do a Net Use

October 26, 2011 at 06:29:08
Specs: Windows XP
Here is my issue I have decided to use NTback up to run a back up while the user is logged of at night. While the computer is logged off the mapped drive needed for the back up isnt mapped. Can the net use command be applied to map the drive with the correct creditials to copy the files. Here is what I have so far

net use Z: \\Share\Files\Eric /USER:DOMAIN\Username password

ntbackup backup "C:\Documents and Settings\user\My Documents" /f "Z:\ERIC\QuickBOOKs\Test.bks" /v:yes /m normal

ntbackup backup "C:\Program Files\Intuit\Quickbooks 2006" /f "C:\Quickbooks Data Back up\Data" /v:yes /m normal

ntbackup backup "C:\Documents and Settings\user\Application Data\Intuit" /f "C:\Quickbooks Data Back up\User" /v:yes /m normal

The back up works great as a scheduled task but as soon as I log the computer off it kinda breaks. Am I going in the right direction.

See More: Get a batch file to do a Net Use

Report •

October 26, 2011 at 08:16:06
What user are you running the scheduled task as? Make sure it is a user who has access to the shared resource.

Report •

October 26, 2011 at 09:06:08
The user has access to the drive. I can't tell what part broke in the script it just tells me that NTbackup didnt have the destination available.

Report •

October 27, 2011 at 05:55:52
I used the UNC name for the drive in the NTBackup command line Ran as a Domain admin. The scheduled task ran fine thanks

Report •

Related Solutions

October 27, 2011 at 06:23:30
Add logging, report back.

How To Ask Questions The Smart Way

Report •

Ask Question