• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

logon.bat for win2k/xp domain

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

roYal

Member
Joined
Jun 17, 2002
Location
Chicago, IL
I have winxp and win2k workstatiosn in this domain. Check out this logon script.

net use g: //ita01/ita_main/elan_temp
copy g:\HOSTS c:\winnt\system32\drivers\etc
net use g: /disconnect

Except, for the winxp machines, this wont work. How can i make it so if it sees the machine is winxp, that it'll use winxp directory, and for win2k, it'll use the win2k directoy. Somethign like if comptuer = win2k {use winnt}, i knwo that's not programming code, i'm just makign something up so you understand better. Thanks.
 
Could you check the OS environment variable?

I know on my Win 2k box it shows as Windows_NT, not sure on XP though. So long as it is different, you could do an IF statement against that.

edit:

or one better, just copy the file to the SystemRoot environment variable. On 2k it is C:\winnt.

I suppose if it has to be in the system32 dir, you could just concatenate the rest of the path since everything after SystemRoot should be the same.
 
i could've just used %systemroot% actually. However, all i was trying to do was make dns records. I was testing something, but i said screw it, and just added a dns record into the server.
 
Back