Link to home
Start Free TrialLog in
Avatar of Indie101
Indie101

asked on

Writing a batch file\script to run logon script?

Have an issue for an user, one of his network drives will slip from time to time, won't be picked up when logons script run, so i run the net use [drive letter] /delete command, (why is this the case), also i want to create a little batch file and have him run it from his desktop if needs be, so i have the following

net use [drive letter] /delete /y

How do i call or run the logon script from \\server\folder\logon.exe

Help is much appreciated
Avatar of Robberbaron (robr)
Robberbaron (robr)
Flag of Australia image

GroupPolicy works well for setting logon scripts but obviously only in a domain and usually set everyone the same.

at time of logon, no access is available to local system, only to the domain NETLOGON area.

NET USE X: /delete /y
\\Server\folder\logon1.cmd or whatever you script is called now.

The script may be within the GroupPolicy, in which case you may have to move it to an accessible area, and update the Poilicy to call the new location.
Avatar of Indie101
Indie101

ASKER

Thanks robber baron, as i said the network drive can slip for user, i have to from time to time go to his pc and run the net use X: /delete command and run the logon script manually, is it possble to run a batch file for the user while i look into group policy?
yes. the batch file is just the command you already know.
provided you know the name of the normal logon script... is this a domain PC ?

open notepad.
NET USE X: /delete /y
\\Server\folder\logon1.cmd

then save as Reconnect.cmd to C:\ or wherever.  Even MyDocs.
then create a shortcut to reconnect.cmd on desktop.

Thanks again, it is a domain pc, tried it, doesnt work, logon script is an .exe file not a .cmd file located on one of our DC's, was looking for a short term fix, rather than group policy
ASKER CERTIFIED SOLUTION
Avatar of Robberbaron (robr)
Robberbaron (robr)
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
logon.exe is a known virus result as well....

My SBS2003 / XP network does not have LOGON.EXE anywhere.
Yeah think it may have been specially written, not to familar with kixtart. is a kix.exe ,doing some work\study while main guy on holidays
kixtart uses scripts usually. eg kixtart.exe  logon.kix
So it shouldnt take it as desribed then,
NET USE X: /delete /y
\\Server\folder\logon.exe

Doesnt seem to....thanks again, sorry for any misunderstanding...

can you post the current logon script or command line ?

How is this script assigned to each computer ?