Re: help on login script

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



SG <sguo@xxxxxxxxxxxxxxxx> wrote:
Hi,
Our DC is windows 2003 sp1, 90% of clients are windows XP pro. I'm
changing my login script in dos batch file to acheive this:
If login name is "frank", then run "net use y: \\server\folder".

My script is:

if %username%==frank goto dist_special
dist_special
net use y: \\server\folder
end

It works for any user even the login is not frank. I don't follow
this. Can anyone help me please?

Thanks in advance,
Sarah

Well, a couple of things. If you want the goto thingy to work, you have to
preface it with a colon -

----------------------
if blah goto whatever

:whatever
some other command
----------------------

If that's just a typo, perhaps you haven't included enough of the login
script for us to know what happens if someone's username is not Frank. I
suppose you could insert

exit
right after the if ...

but you could also try

if %username%==frank net use y: \\server\folder /persistent:no

or use IFMEMBER from the resource kit, so you can do all this with AD groups
and not muck around with individual user accounts?


.



Relevant Pages

  • Re: [Full-Disclosure] smbmount disrupts Windows file sharing.
    ... and the case of another windows client ... I did transmogrify the shell script to run in Windows ... REM winblast V3 - DoS on WinXP, ... if ERRORLEVEL 1 goto exit0 ...
    (Full-Disclosure)
  • Re: Expiring inactive accounts
    ... i suggest you to schedule a script to automate this task. ... In Windows NT 4.0 I used to enable the checkbox "User must login to ... In Windows 2000 how do I achieve this? ...
    (Focus-Microsoft)
  • Re: Running a script then user fails to login to domain
    ... > Is there a way to run a script when someone fails to login ... You can enabled Account Logon Auditing and then use Performance ... Q300504 Configure Windows 2000 Server to Notify You of Security ...
    (microsoft.public.win2000.security)
  • SENDKEYS to Login to Windows
    ... Guys ~ has anyone used SendKeys to script a login to Windows. ... we have a Windows PC sitting at a logon screen and with a ?app ... Can it be done were a Sendkeys will actualy pull up the login screen? ...
    (microsoft.public.scripting.vbscript)
  • Re: SENDKEYS to Login to Windows
    ... but you could write some auto logon entry into ... we have a Windows PC sitting at a logon screen and with a 'app ... > deploy tool' deliver a script to login as local admin. ...
    (microsoft.public.scripting.vbscript)