?
Solved

I need help writing a login script to patch for the recent MS JScript Vulnerability

Posted on 2003-03-21
2
Medium Priority
?
200 Views
Last Modified: 2008-03-17
I need help writing a login script to patch for the recent MS JScript Vulnerability.  98/Me/NT4 machines run sample1.exe.  2000/XP runs sample2.exe.  So basically I need a batch that would identify the OS and apply the correct patch pertaining to the OS.  Since the patch requires a reboot is there any way to tell the batch that if the patch has been already been installed from a previous login do not run the rest of the batch.

Thanks any help would be greatly appreciated
Jay
0
Comment
Question by:jcallwood
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 10

Accepted Solution

by:
ryangorman earned 1000 total points
ID: 8185888
How To Determine The OS Type In A Logon Script
http://www.ultratech-llc.com/KB/?File=OSType.TXT

Note that this site has many related scripting articles.

You can determine if the script has perviously run by checking for a registery entry or file that is created by the script.

Try the following script

@echo off
if exist flag.txt goto Detected

:NotDetected
echo Script has not run before
echo y > flag.txt
goto end

:Detected
echo Previous run detected
echo deleting evidence
del flag.txt
goto End

:End
echo.
dir /b flag.txt
0
 
LVL 22

Expert Comment

by:Christopher McKay
ID: 8187749
Here's a batch file for determining what OS is on the system. Feel free to edit it and use it for your needs.

Batch file starts:

@ECHO OFF
VER|FIND "XP">NUL
IF NOT ERRORLEVEL 1 GOTO WinXP
VER|FIND "2000">NUL
IF NOT ERRORLEVEL 1 GOTO Win2K
VER|FIND "NT">NUL
IF NOT ERRORLEVEL 1 GOTO WinNT
VER|FIND "Mil">NUL
IF NOT ERRORLEVEL 1 GOTO WinME
VER|FIND "98">NUL
IF NOT ERRORLEVEL 1 GOTO Win98
VER|FIND "95">NUL
IF NOT ERRORLEVEL 1 GOTO Win95
GOTO BADOS

:WinXP
ECHO WinXP
GOTO END

:Win2K
ECHO Win2K
GOTO END

:WinNT
ECHO WinNT
GOTO END

:WinME
ECHO WinME
GOTO END

:Win98
ECHO Win98
GOTO END

:Win95
ECHO Win95
GOTO END

:BADOS
ECHO This OS is not supported
GOTO END

:END

Batch file ends

This combined with the recommendation by ryangorman will do what you desire.

Hope this helps!

:o)

Bartender_1
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many people tend to confuse the function of a virus with the one of adware, this misunderstanding of the basic of what each software is and how it operates causes users and organizations to take the wrong security measures that would protect them ag…
I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question