wehuberconsultingllc.com

wehuberconsultingllc.com random header image

Using remote drives in a scheduled job

August 5th, 2008 · No Comments · General

Recently I was debugging why a backup of a QuickBooks file was not working. A scheduled job running on the server was supposed to create a compressed encrypted version on a removable USB drive. The job was written by someone else and I guess they never checked to see if it worked!? I found that itt worked when I ran it interactively but it failed when I ran it as a schedule job. It took me a while to figure this problem out but the QuickBooks folder was actually a shared folder on another computer and the drive mapping was not available in the batch environment. To fix the problem I added the following statements to create a drive mapped as ‘r:’.

	Dim objNetwork
	Set objNetwork = WScript.CreateObject("WScript.Network")
	strLocalDrive = "r:"
	strRemoteShare = "\\myserver\Backups_Daily"
	objNetwork.MapNetworkDrive strLocalDrive, strRemoteShare, False

Related posts:

Related posts brought to you by Yet Another Related Posts Plugin.

Tags:

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment