Jump to content

Recommended Posts

Posted

Hi all

 

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.

 

Cheers

Nath

120606_startmenusync_err.jpg

Posted

As I said:

 

Its just the first error thats confusing - ignore the rest after "Defaulting to Windows directory".

 

I think its the logging I have in the script - but it doesnt make sense that it works on the other laptops but not this one surely?

 

ECHO. >> \\\\test.log

 

Why one machine and not the other?

 

Nath

120606_startmenusync_err2.jpg

Posted

I'd have thought so yes...

 

DNS? Whats that? :p

 

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]

 

Nath

Posted

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.

Posted
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.:

 

@ECHO OFF

ECHO _

ECHO. >> \\\\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 ;)]

 

 

Nath

Posted

No - it shouldnt, it doesnt usually. Got loadsa scripts with it in.

 

It will just output a blank line [which of course, is a neato way to make a blank line in a log lol] in case u didnt know.

 

[see my edit up above - nothing in the script seems to be upseting it - its just confsing me to hell - why this machine??? /cry hehe]

 

Nath

Posted

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?

Posted

Dont think so.

 

Its the simplest script ever.

 

the only comands in it are xcopy, net use, and echo.

there are a few normal variables - %DATE%, %TIME%, %USERNAME%, %SystemRoot% & %USERPROFILE%.

there is one hidden share name in it for the log [as u can see from the snippets above].

 

And it works fine on every other laptop.

 

Nath

Posted

OK, if you run any batch file such as:

 

echo hello

pause

 

from a location on a UNC path you will get that message. I assumed that you could get around it by cd'ing, but that apparently isn't the case (i've just tested it). Have you tried adding a "pause" at the start of the script to make sure that it isn't doing it really quickly on the others.

 

Is the login script setting completely identical in all user accounts you've used?

Posted
OK, if you run any batch file such as:

 

echo hello

pause

 

from a location on a UNC path you will get that message. I assumed that you could get around it by cd'ing, but that apparently isn't the case (i've just tested it).

 

As did i when u mentioned it hehe

 

Just tried a script consisting of just what you have there and removed the other one from logon. Exactly the same result with the error message.

 

Have you tried adding a "pause" at the start of the script to make sure that it isn't doing it really quickly on the others.

 

"on the others"?

 

The rest of the commands are executing fine - its just the error message and in turn, doesnt perform what it is meant to for some reason.

 

Is the login script setting completely identical in all user accounts you've used?

 

The log in script applies to user who is a member of the domain staff group and is logging onto a laptop.

 

The script is attached to the user config of the GPO - so that it executes when they logon [basically for ease of use to the user - if it was computer based, they'd have to restart should they need a 'start menu refresh'].

 

It was working for at least two other users [that i have seen] and reportedly working fine for others - just this one laptop it doesnt work on and i notice this message. I tried on my staff user and does the same as it does on the user of the laptop.

 

Any ideas?

Nath

Posted

Found this on system error 85

 

net use /persistent:yes is default settings for NT and win2000/XP. If you have mapped some network drives and check the reconnect at logon, or your network uses logon script to map network drives, the mapped network drives may show red Xs. If you enable echo and pause the logon script or if using net use to map the same drive manually, you may get "System error 85 has occurred. The local device name is already in use." One thing you may want to try is using net use /persistent:no, for example, net use i: \\servername\folder /persistent:no

 

Another thing to try is

net use x: /delete

(where X: is the drive letter in question

Posted
There is a KB article on it. I shall attempt to find it but it's difficult to search for. The % get's filtered out by search engines.
Posted

Hmm interesting.... :-k

This appears to be a problem if you have mulitple occurances of %0 on a line of the script or if the %0 occurs at the start of the line.

 

Another interesting point to note is that on XP the command processor for logon scritps must automagically CD to the share where the script lives.

This makes the %0 redundant.

0% is not required for Microsoft Windows NT, Microsoft Windows 2000, or Windows XP. It is required for Microsoft Windows 95, Microsoft Windows 98, and Microsoft Windows Millennium Edition (Me)

 

p.s. the last modification date for the cited KB article is in 2003 which predates the release of XP SP2. So strictly speaking this isn't something peculariar to SP2 :p .

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...