?
Solved

Logon Script generating Error

Posted on 2006-03-22
7
Medium Priority
?
459 Views
Last Modified: 2008-02-01
This is more a minor inconvenience than an actual problem, but it's one I'd like to solve.

I have a logon script that is applied to every user who logs in.  It is kept on the DC\NETLOGON share and is simply called logon.bat.  Every time it runs it generates the following error:

'\\SERVER\NETLOGON'
CMD.EXE was started with the above path as the current directory.  UNC paths are not supported.  Defaulting to Windows directory.

It then goes on and runs the script as normal.

How do I stop this error?

If I run the script from the command line (caliing \\server\netlogon\logon.bat) it runs fine with no errors.

0
Comment
Question by:Ziggie013
  • 3
  • 3
7 Comments
 
LVL 9

Expert Comment

by:Jeff Beckham
ID: 16260807
You're calling something inside the .bat that doesn't like where it's being called from.  You can try prepending a "%0\..\" to the command or map a drive letter and then run whatever it is you're trying to do inside the logon script.
0
 
LVL 1

Author Comment

by:Ziggie013
ID: 16260908
I am simply running net commands.  When I add the %0 to the front of the first line, I get the same error, and then get "The directory name is invalid"  
Here are the first few lines of the logon script:

@net time /set /yes
@if exist I:\_Masters\ (
@echo I Drive already mapped
) ELSE (
@net use i: /d
net use i: \\server\share
)
0
 
LVL 9

Assisted Solution

by:Jeff Beckham
Jeff Beckham earned 600 total points
ID: 16261170
Are you specifying "\\SERVER\NETLOGON\logon.bat" on the logon script for the user?  If so, all you should need to supply is the file name.  Windows assumes the netlogon share from the authenticating domain controller.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 1

Author Comment

by:Ziggie013
ID: 16261562
I was specifying the full UNC to the logon script.  I removed it and the logon script doesn't run at all now.  No errors popup on the local machine.  In Event Viewer I get the following:

"Could not execute the following script logon.bat. The system cannot find the file specified"
0
 
LVL 1

Accepted Solution

by:
brtweir earned 600 total points
ID: 16261729
This is not a problem - You will this occur whenever a script runs from a UNC as opposed to a drive letter. JEBeckham is correct in his statement, however if this is  a Windows 2000 / 2003 environemnt you need to put the script in the %dcname%\sysvol\fqdn\scripts directory and then the script will run just fine without specifying the whole UNC path.
0
 
LVL 1

Author Comment

by:Ziggie013
ID: 16261802
Ah ha, that did it!

Like i said, it was just annoying, and it delayed the logon script about 15 seconds.  So now I don't have that problem!
0
 
LVL 9

Expert Comment

by:Jeff Beckham
ID: 16261814
Do you have more than 1 domain controller in your domain?  If so, your script might not be replicating to the other DCs, one of which might be authenticating you when you logon to the domain.  The logon script needs to be either manually copied to the NETLOGON share of all of your DCs or replication needs to be given time to replicate the script to the remaining DCs.
0

Featured Post

Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

Question has a verified solution.

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

by Batuhan Cetin In this article I will be guiding through the process of removing a failed DC metadata from Active Directory (hereafter, AD) using the ntdsutil tool in a Windows Server 2003 environment. These steps are not necessary in a Win…
Numerous times I have been asked this questions that what is it that makes my machine log on so slow, there have been cases where computers took 23 minute exactly after taking password and getting to the desktop. Interesting thing was the fact th…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…

829 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