Windows Thread, Stupid CMD error with logon script in Technical; Hi all
Trying to work out why one machine throws up the error in the following image attachment, while the ...
Trying to work out why one machine throws up the error in the following image attachment, while the other laptops work fine.
Its a little script that I have assigned to allow Staff users to sync the Start Menu with their local profile on the laptop - and it works a treat for another user/laptop.
On this one laptop however [its a fairly new install of XP too on the laptop and is in the OU with the other laptops] I get this error appear and I cant work out why.
Its just the first error thats confusing - ignore the rest after "Defaulting to Windows directory".
Any one have any thoughts? Trying to get this problem out of the way so I can carry on with a ton of other stuff.
I mean its on the domain fine AFAIK and seems to pick up domain / GP changes fine.
Whats the command line thingy again i can try from the client machine that does a check on things? [or is that a imaginary one that I've thought up hehe]
It does that if you try to make a UNC path the working directory. e.g if you type "cd \\server\share\" into a command prompt it will error. Try cd'ing to a local path as the first line of your script to stop it doing that.
FYI the script will still run, but will change to your windows directory as its working directory. This is an incredibly dangerous design choice by Microsoft considering the damage some scripts could cause if they were run with c:\windows as the current directory.
It does that if you try to make a UNC path the working directory. e.g if you type "cd \\server\share\" into a command prompt it will error.
Try cd'ing to a local path as the first line of your script to stop it doing that.
Tried but no difference
Not used a single CD in the script [well, have now to see if any difference but zero difference]
Interestingly, I've noticed that it seems to throw up the error straight away in the script i.e.:
Code:
@ECHO OFF
ECHO _
ECHO. >> \\<servername>\<hiddenlogshare>\test.log
Its doing it on the @ECHO OFF - but no idea why, and again, why on this laptop and not others? :S
EDIT: Removed @ECHO OFF and still does it, yet all the other commands work fine as intended [as i can see them now ]
The echo. is meant to produce an empty line just the end of line characters 0x0d and 0x0a.
CD does not recognise UNCs you either have to use PUSHD which assigns the next availible drive letter or an explicit NET USE
or the %0\..\ form to refer to path relative to the path of the script file.
Anything in Application Log of the client laptops?