+ Post New Thread
Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 38
Windows Thread, Stupid CMD error with logon script in Technical; Does it rely on any environment variables specific to the machines?...
  1. #16

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,421
    Thank Post
    644
    Thanked 967 Times in 667 Posts
    Blog Entries
    2
    Rep Power
    328

    Re: Stupid CMD error with logon script

    Does it rely on any environment variables specific to the machines?

  2. #17
    tarquel's Avatar
    Join Date
    Jun 2005
    Location
    Powys, Mid-Wales, UK
    Posts
    1,740
    Thank Post
    13
    Thanked 45 Times in 35 Posts
    Rep Power
    30

    Re: Stupid CMD error with logon script

    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

  3. #18
    sahmeepee's Avatar
    Join Date
    Oct 2005
    Location
    Greater Manchester
    Posts
    795
    Thank Post
    20
    Thanked 70 Times in 42 Posts
    Rep Power
    34

    Re: Stupid CMD error with logon script

    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?

  4. #19
    tarquel's Avatar
    Join Date
    Jun 2005
    Location
    Powys, Mid-Wales, UK
    Posts
    1,740
    Thank Post
    13
    Thanked 45 Times in 35 Posts
    Rep Power
    30

    Re: Stupid CMD error with logon script

    Quote Originally Posted by sahmeepee
    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.

    Quote Originally Posted by sahmeepee
    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.

    Quote Originally Posted by sahmeepee
    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

  5. #20

    Gatt's Avatar
    Join Date
    Jan 2006
    Posts
    6,819
    Thank Post
    881
    Thanked 685 Times in 454 Posts
    Rep Power
    505

    Re: Stupid CMD error with logon script

    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
    Code:
    net use x: /delete
    (where X: is the drive letter in question

  6. #21

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,850
    Thank Post
    110
    Thanked 598 Times in 514 Posts
    Blog Entries
    1
    Rep Power
    227

    Re: Stupid CMD error with logon script

    %0
    Doesn't work correctly in XP SP2.

  7. #22

    Join Date
    Feb 2006
    Posts
    1,187
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Re: Stupid CMD error with logon script

    Can you expand on that Geoff? In what way doesn't it work correctly?

  8. #23

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,850
    Thank Post
    110
    Thanked 598 Times in 514 Posts
    Blog Entries
    1
    Rep Power
    227

    Re: Stupid CMD error with logon script

    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.

  9. #24

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,850
    Thank Post
    110
    Thanked 598 Times in 514 Posts
    Blog Entries
    1
    Rep Power
    227

    Re: Stupid CMD error with logon script


  10. #25

    Join Date
    Feb 2006
    Posts
    1,187
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Re: Stupid CMD error with logon script

    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 .

  11. #26

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,850
    Thank Post
    110
    Thanked 598 Times in 514 Posts
    Blog Entries
    1
    Rep Power
    227

    Re: Stupid CMD error with logon script

    Yes, also if you have:

    Code:
    %0\Something\something.exe option1 option2
    the options get dropped.

  12. #27
    tarquel's Avatar
    Join Date
    Jun 2005
    Location
    Powys, Mid-Wales, UK
    Posts
    1,740
    Thank Post
    13
    Thanked 45 Times in 35 Posts
    Rep Power
    30

    Re: Stupid CMD error with logon script

    um..... kinda lost now guys

    Discovered that it is happening on other laptops also.

    I've tried replacing the xcopy command with a robocopy method too, but the result is the same...

    instead of copying the start menu from the mapped share at Z:, it copies the My Documents folder [or possibly the networked home dir [H:] that My Documents is redirected too on desktop pc's] into the start menu instead...

    Not too fussed about the error message - just cant get the thing to work.

    Any one want to see the crappy script?

    Nath

  13. #28

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,421
    Thank Post
    644
    Thanked 967 Times in 667 Posts
    Blog Entries
    2
    Rep Power
    328

    Re: Stupid CMD error with logon script

    Yeah, come on.. post the code and we'll have a look

  14. #29

    Join Date
    Feb 2006
    Posts
    1,187
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Re: Stupid CMD error with logon script

    Yeah, Nath. Don't leave us the geeks slathering in anticipation. Post the blessed thing

  15. #30
    tarquel's Avatar
    Join Date
    Jun 2005
    Location
    Powys, Mid-Wales, UK
    Posts
    1,740
    Thank Post
    13
    Thanked 45 Times in 35 Posts
    Rep Power
    30

    Re: Stupid CMD error with logon script

    Code:
    @ECHO OFF
    
    REM ECHO _
    
    ECHO. >> \\<servername>\<sharename>$\test.log
    ECHO -START- %DATE% - %TIME% - SYNCING LAPTOP START MENU for %USERNAME% - >> \\<servername>\<sharename>$\test.log
    
    REM ECHO __
    
    ECHO -STAGE1- %DATE% - %TIME% - connection to server - >> \\<servername>\<sharename>$\test.log
    net use Z: \\<servername>\<profileshare>$\Pre2k\Staff\Laptop /PERSISTENT:NO
    
    REM ECHO ___
    
    ECHO -STAGE2- %DATE% - %TIME% - COPYING START MENU TO LOCAL PROFILE - >> \\<servername>\<sharename>$\test.log
    robocopy "Z:\Start Menu" "%USERPROFILE%\Start Menu" *.* /E /Z /NDL /NFL /NJH /LOG+:\\<servername>\<sharename>$\test.log
    
    REM ECHO ____
    
    ECHO -STAGE3- %DATE% - %TIME% - dis-connecting from server - >> \\<servername>\<sharename>$\test.log
    net use Z: /DELETE
    
    REM ECHO _____
    
    ECHO -COMPLETE- %DATE% - %TIME% - Process over for %USERNAME% - >> \\<servername>\<sharename>$\test.log
    no laughing in the back now :P

    As you can see, its a very simple script and the crazy thing is that even if you have a script of "echo hello world" and nothing else, you still get the CMD error thing.

    Is there something else that i'm forgetting with this? permissions or something perhaps?

    As it appears to be doing the same thing [above in the other post] for all the other laptops, i reckon ppl are gonna get narky real quick.

    I already had the /persistant:no and a /delete after the job is done [not new at batch script writing - tho i dont get too complicated if i can help it hehe].

    Any thoughts would be very welcome.

    Nath.



SHARE:
+ Post New Thread
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. logon script for printer
    By ozzy in forum Scripts
    Replies: 6
    Last Post: 22nd November 2007, 04:03 PM
  2. Printers logon script error messages
    By indie in forum Windows
    Replies: 1
    Last Post: 14th September 2007, 12:34 PM
  3. Logon script & Printer script question.
    By Galway in forum Windows
    Replies: 3
    Last Post: 29th August 2007, 12:00 PM
  4. BGInfo in logon script example?
    By ninjabeaver in forum How do you do....it?
    Replies: 16
    Last Post: 24th August 2007, 01:49 PM
  5. Yet another Logon Script
    By ajbritton in forum Windows
    Replies: 3
    Last Post: 19th June 2006, 10:47 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •