Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hello,
I'm trying to write a logonscript that performs a task based on the operating system of the client.
Does anybody know how to write a batchfile/logonscript which can do this?
Help is very appreciated,
Thank you all!
RB

Easy mate you just write a standard batch file which has what you want in it.
Then you make the user logon to this script.
goto cmd from run in the start menu.
Then type net /? and it will give you most of the dos commands that you can use

Hello Dave,
Thanks for your reply but what i actually ment was,i want to write a batch file which can detect the OS of the client logging on,and based on the OS type found it performs a different task.
So when the client is running Win2000 it performs task A,and when it runs WIn98 t performs task BHow can a script detect the clients OS?
Thanks,
RB

You can do this by using wsh. Using the WMI you can read the registry setting for the version of NT that the system is running.
Then just use the script to perform the actions you want. ie. mapping drives etc. If you use the tool 'IFMember' from the NT resource kit, you can run specific parts of the script depending on who the user is. ie. map finance printer for finance department users, etc. Have a look at www.winguides.com for some scripting help and some other guides.

if %OS%.==Windows_NT. goto WinNT
if %windir%.==. goto DOS
:Win9x
echo Win9x stuff here...
goto end
:DOS
echo DOS stuff here...
goto end
:WinNT
echo WinNT stuff here...
goto end
:end

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |