Read Registry as part of the login script

S

slingeruk

Dear all

I'm having a bit of a problem with a login script and was hoping somebody
might be able to help. I need to come up with a login script that will map
lower than the initial share of the folder structure (ie
\\server\share\folder). This works fine with W2k, but needs a subst command
for NT 4.0 machines. To get around this I have found a registry key
(HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Current Version) which
displays the version number of the OS (4.00 for NT, and 5.00 for W2k). What
I need to do now is somehow take this key, and use it as a variable in a
login script (batch file rather than VB script). Does anyone know of using
this key in the script? (An example would be great).

Thanks in advance

Steve
 
W

Walter Schulz

I'm having a bit of a problem with a login script and was hoping somebody
might be able to help. I need to come up with a login script that will map
lower than the initial share of the folder structure (ie
\\server\share\folder). This works fine with W2k, but needs a subst command
for NT 4.0 machines. To get around this I have found a registry key
(HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Current Version) which
displays the version number of the OS (4.00 for NT, and 5.00 for W2k). What
I need to do now is somehow take this key, and use it as a variable in a
login script (batch file rather than VB script). Does anyone know of using
this key in the script? (An example would be great).

Not needed.

IF DEFINED %Programfiles% goto :W2k
goto :NT

:w2k
net use k: \\server\share\folder
goto :EOF
:NT
subst K: \\server\share\folder

Ciao, Walter
 
W

Walter Schulz

IF DEFINED %Programfiles% goto :W2k

Sorry, error in line above

IF DEFINED Programfiles goto :W2k

Ciao, Walter
 
S

Scott Losawyer

ver |find "4.0"
if errorlevel 1 goto:2000
if not errorlevel 1 goto:NT4

if you have xp boxes, check for "XP" in ver
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top