+ Post New Thread
Page 1 of 3 123 LastLast
Results 1 to 15 of 38
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 ...
  1. #1
    tarquel's Avatar
    Join Date
    Jun 2005
    Location
    Powys, Mid-Wales, UK
    Posts
    1,740
    Thank Post
    13
    Thanked 44 Times in 34 Posts
    Rep Power
    29

    Stupid CMD error with logon script

    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
    Attached Images Attached Images

  2. #2

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,803
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224

    Re: Stupid CMD error with logon script

    Your trying to map a drive to a drive letter that's already mapped/in use.

  3. #3
    tarquel's Avatar
    Join Date
    Jun 2005
    Location
    Powys, Mid-Wales, UK
    Posts
    1,740
    Thank Post
    13
    Thanked 44 Times in 34 Posts
    Rep Power
    29

    Re: Stupid CMD error with logon script

    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?

    Code:
    ECHO. >> \\\\test.log
    Why one machine and not the other?

    Nath
    Attached Images Attached Images

  4. #4

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,803
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224

    Re: Stupid CMD error with logon script

    Can it see the server? DNS working ok? etc

  5. #5
    tarquel's Avatar
    Join Date
    Jun 2005
    Location
    Powys, Mid-Wales, UK
    Posts
    1,740
    Thank Post
    13
    Thanked 44 Times in 34 Posts
    Rep Power
    29

    Re: Stupid CMD error with logon script

    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

  6. #6
    tarquel's Avatar
    Join Date
    Jun 2005
    Location
    Powys, Mid-Wales, UK
    Posts
    1,740
    Thank Post
    13
    Thanked 44 Times in 34 Posts
    Rep Power
    29

    Re: Stupid CMD error with logon script

    ....running gpresult currently...

    EDIT: Everything seemed to be applying fine/as expected [according to the results too]

  7. #7

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,803
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224

    Re: Stupid CMD error with logon script

    netdiag is what you want.

    Also just running ipconfig /all and checking for saneness is a good idea.

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

    Re: Stupid CMD error with logon script

    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.

  9. #9
    tarquel's Avatar
    Join Date
    Jun 2005
    Location
    Powys, Mid-Wales, UK
    Posts
    1,740
    Thank Post
    13
    Thanked 44 Times in 34 Posts
    Rep Power
    29

    Re: Stupid CMD error with logon script

    netdiag comes up with unknown command [on the client]

    ipconfig /all - looks nice and peachy

    Nath.

  10. #10
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    5,002
    Thank Post
    120
    Thanked 282 Times in 260 Posts
    Rep Power
    108

    Re: Stupid CMD error with logon script


  11. #11
    tarquel's Avatar
    Join Date
    Jun 2005
    Location
    Powys, Mid-Wales, UK
    Posts
    1,740
    Thank Post
    13
    Thanked 44 Times in 34 Posts
    Rep Power
    29

    Re: Stupid CMD error with logon script

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

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

    Re: Stupid CMD error with logon script

    Quote Originally Posted by ChrisH
    Thought so while i was replying hehe :P :P

    Nath

  13. #13
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    5,002
    Thank Post
    120
    Thanked 282 Times in 260 Posts
    Rep Power
    108

    Re: Stupid CMD error with logon script

    ECHO. >> \\\\test.log
    is the "." after echo upsetting it?

  14. #14
    tarquel's Avatar
    Join Date
    Jun 2005
    Location
    Powys, Mid-Wales, UK
    Posts
    1,740
    Thank Post
    13
    Thanked 44 Times in 34 Posts
    Rep Power
    29

    Re: Stupid CMD error with logon script

    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

  15. #15

    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

    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?

SHARE:
+ Post New Thread
Page 1 of 3 123 LastLast

Similar Threads

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