Ziggie013
asked on
Logon Script generating Error
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.ba t) it runs fine with no errors.
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.ba
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.
ASKER
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
)
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
)
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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"
"Could not execute the following script logon.bat. The system cannot find the file specified"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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!
Like i said, it was just annoying, and it delayed the logon script about 15 seconds. So now I don't have that problem!
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.