Scheduled Tasks and Batch file with system variable

G

Guest

I have a batch file that has the following lines in it. The file runs fine if
ran manually but if scheduled it fails at the system variable %logonserver%.
If I schedule it and place a pause after the first line I can see where it
does not pickup the variable %logonserver% it attempts to map z: to
\netlogon\efinstall and fails. Any help would be greatly appreciated.

net use z: %logonserver%\netlogon\efinstall
z:
copy *.* c:\efinstall
c:
net use z: /delete
 
G

Guest

Tony,

This would happen if the environment variable logonserver is only defined in
the local user account and the scheduled tasked is being run under an account
other than the local user account in which the environment variable is
defined.
 
G

Guest

John

Thanks and that makes since. Is there anyway you know of to overcome this. I
need to run a scheduled job on domain connected XP pro workstations in remote
offices and need to temporarily map the z: drive to there local server.
 
G

Guest

If you make logonserver a system variable or create a new system variable to
hold the path, it will be available to all user accounts. To add system
environment variables go to Start -> Control Panel -> System > Advanced >
Environment Variables. Everything in the top windows is local to the current
user while everything in the bottom window is global to all users.
 
G

Guest

John

Thanks, I’m going to give that a try, just trying to figure out how to
create the new variable remotely in a batch like process.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top