Solved

Writing a batch file\script to run logon script?

Posted on 2007-12-05
10
891 Views
Last Modified: 2012-05-05
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
0
Comment
Question by:Indie101
  • 6
  • 4
10 Comments
 
LVL 32

Expert Comment

by:Robberbaron (robr)
ID: 20417136
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.
0
 

Author Comment

by:Indie101
ID: 20418580
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?
0
 
LVL 32

Expert Comment

by:Robberbaron (robr)
ID: 20419355
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.

0
 

Author Comment

by:Indie101
ID: 20419428
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
0
 
LVL 32

Accepted Solution

by:
Robberbaron (robr) earned 350 total points
ID: 20424165
Would be first time I d seen an exe as logon "script".  Unless it was especially written for your location.

But shouldnt matter.  Just call it from the batch file.
NET USE X: /delete /y
\\Server\folder\logon.exe
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 32

Expert Comment

by:Robberbaron (robr)
ID: 20424477
logon.exe is a known virus result as well....

My SBS2003 / XP network does not have LOGON.EXE anywhere.
0
 

Author Comment

by:Indie101
ID: 20440389
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
0
 
LVL 32

Expert Comment

by:Robberbaron (robr)
ID: 20444867
kixtart uses scripts usually. eg kixtart.exe  logon.kix
0
 

Author Comment

by:Indie101
ID: 20448087
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...

0
 
LVL 32

Expert Comment

by:Robberbaron (robr)
ID: 20454624
can you post the current logon script or command line ?

How is this script assigned to each computer ?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is about my first experience with programming Arduino.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now