Welcome to MSFN

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.


Sign in to follow this  
Followers 0
svortevik

Why wont taskkill work?

5 posts in this topic

When installing some of my programs I need taskkill to run, but it wont.

Can anyone look over my commands and tell med whats wrong?

REG ADD %KEY%\009 /VE /D "BulletProof FTP Server" /f
REG ADD %KEY%\009 /V 1 /D "%PP%ftpsetup.exe /verysilent" /f
REG ADD %KEY%\009 /V 2 /D "taskkill.exe /IM bpftpserver.exe" /f
REG ADD %KEY%\009 /V 3 /D "%PP%bpftpserver.exe" /f

REG ADD %KEY%\016 /VE /D "DVD Identifier" /f
REG ADD %KEY%\016 /V 1 /D "%PP%DVDIdentifier3.6.3.1.exe /VERYSILENT" /f
REG ADD %KEY%\016 /V 2 /D "taskkill.exe /IM "DVD Identifier.exe"" /f

REG ADD %KEY%\038 /VE /D "Opera Search ini editor" /f
REG ADD %KEY%\038 /V 1 /D "%PP%OperaSearchIni\opsedsetup123.exe /SILENT" /f
REG ADD %KEY%\038 /V 2 /D "taskkill.exe /IM opsed.exe" /f

REG ADD %KEY%\052 /VE /D "TuneXp 1.5" /f
REG ADD %KEY%\052 /V 1 /D "%PP%TuneXP15.exe /VERYSILENT /SP-" /f
REG ADD %KEY%\052 /V 2 /D "%PP%Sleep.exe 10" /f
REG ADD %KEY%\052 /V 3 /D "taskkill.exe /IM tunexp.exe" /f

0

Share this post


Link to post
Share on other sites

Try adding the /F switch to "forcefully terminate the process(es)."

You could also try using PsKill or NirCMD.

0

Share this post


Link to post
Share on other sites

Pretty sure usin Taskill in Runonceex like that will cause the executeable to run first then execute taskill next not really servin the purpose. I generally script it through Autoit.

0

Share this post


Link to post
Share on other sites

svortevik, I don't know what your %pp% expands to, but at first glance I noticed that for the first two you might have a problem with the quotes. With RunOnceEx if you need more quotes you will need to preced them with a "\" to get them to transfer properly.

So, your line

REG ADD %KEY%\016 /V 2 /D "taskkill.exe /IM "DVD Identifier.exe"" /f

should be...

REG ADD %KEY%\016 /V 2 /D "taskkill.exe /IM \"DVD Identifier.exe\"" /f

If you expansion variable includes any spaces when expanded, then you'll have the same problem (I know as I learned the hard way!).

Your first line has the executable being executed just after you've killed it!!!

The other two I'm not too familiar with, so I can only ask why use sleep.exe and then taskill?? You might be able to wrap them in a Winrar sfx file or use 7zip for a silent install, but others here can better advise you.

0

Share this post


Link to post
Share on other sites

PP=%cdrom%\Install\

I`ll try to use "\" and see if that helps.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.