Solved

Ending tasks in command prompt

Posted on 2002-06-12
6
213 Views
Last Modified: 2010-04-13
I need to know if there is a way to stop and end tasks or processes that are running on a windows 2000, XP, 98, and 95 PC for wihtin the command prompt or when booting into the PC with a win9x bootdisk. I have had some users open an email virus that just puts a setup.exe into the startup folder in the startmenu and you can't end the task to delete the file. Not a bad virus just really annoying. But I'd like to create a batch file it this is possible and mail it to those that opened it and have then run it so I don't have to go to the 100 some odd users that opened it.

Thanks a ton
RBennett

 If you would like to read about it go to www.mcafee.com go to the virus info lib. and search for password and click the first link.
0
Comment
Question by:Ryan Bennett
6 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 200 total points
ID: 7073656
Go to http://www.sysinternals.com/ntw2k/freeware/pstools.shtml and get these command line utilities 'pskill' can certainly do what you want.

>>or when booting into the PC with a win9x bootdisk

Err, when you boot your system from a (DOS!) boot disk, you won't have to kill a process...
0
 
LVL 4

Expert Comment

by:Nevaar
ID: 7073781
How about deleting the executable and the menu link via a domain login script?
0
 
LVL 22

Expert Comment

by:Adam Leinss
ID: 7075605
jkr is on the right track.  You can use pskill in a batch file to kill the process and then do something like

del C:\documents and settings\%user%\Start Menu\

%user% is something I made up.  You would have to find a utility to return who is currently logged into the variable.  WhoamI (http://www.simtel.net/pub/pd/57930.html) might help, but I'm not sure how to pipe its username info into the batch variable.  Perhaps Windows 2000 already defines an environmental variable that someone can confirm or deny.
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 22

Expert Comment

by:Adam Leinss
ID: 7075613
Oh yeah, if you do have a domain setup, Nevaar's solution is VERY easy!
0
 
LVL 22

Expert Comment

by:Adam Leinss
ID: 7075645
Just took a guess and %USERNAME% holds the name of the current user that is logged in:

Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

Z:\>echo %username%
ALeinss

So use %username% instead of %user%
0
 

Author Comment

by:Ryan Bennett
ID: 7075714
Never before have I gotten answers that would all solve my problem, I would like to award the points to you all!! Thanks a bunch for your time an efferts.

 These pstools rock! Thanks for the link. After running this all they had to do was right-click and del the shortcut out of their start menu I didn't even have to leave my office once.

 The domain would have worked but we don't have a domain setup yet but thanks.
 And the batch file tips would really help buy they seem to have taken care of the shortcut ok thanks!!

 Great,
 RBennett

 
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

In the hope of saving someone else's sanity... About a year ago we bought a Cisco 1921 router with two ADSL/VDSL EHWIC cards to load balance local network traffic over the two broadband lines we have, but we couldn't get the routing to work consi…
NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

910 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now