Jump to content

Recommended Posts

Posted

I just wrote some new code that uses tskill. I wrote it at work on XP Pro. Took it home, it would not work. Said file not found. After cussing at it I Google'd it and tskill is for XP and lower. Vista uses taskkill. No big deal. Or so I thought.

Example:

XP:

tskill Sleep

Vista:

taskkill /im Sleep.exe

Extra arg required and the .exe extension is required. Throws everyone's config file off if migrate from XP to Vista, or add a first instance on Vista it will not work.

Anyone have or know of a Vista compatible tskill I could put in the Tools folder to keep backward compatibility?


Posted

So I have been doing some thinking.............tskill should have been made into a system variable, %tskill%, from the very start. It wasn't, ah well, now it is going to make things a little harder for the end user.

The only real soultion is to delete it from the drop-down box so it is up to the user to know which version to use: tskill or taskkill. AND how to use each one. See above.

I don't see it being feasible for me to write code to check how the user calls the command. Too many headaches.

If you have a problem with this, tell me now. Else it is headed for the cutting block.

  • 4 weeks later...
Posted

I made a way to internally handle this problem. Now I need to know what OS uses what command.

Vista: taskkill

XP: tskill

2000: tskill

2003: ???

2008: ???

I am assuming if not Vista, then use tskill. Tell me if I am wrong.

Posted

I did vLite it and probably did remove it. Sweet. Either way, code already done for XP/Vista. Can take it back out.

Thanks

Posted

Maybe not so sweet.

I looked at 2 factory installed Dell's at work, neither had tskill. What Vista are you using, Ricktendo?

Posted

New Vista Ultimate SP1 x64 build has it in %windir%\system32 as version 6.0.6001.18000. The screenshot here shows version .22291, which appears to come from KB958652.

So, if you don't have it by default, install 958652. However, I'm not sure how a Vista build is missing this file, as the hotfix installs for all versions (including the basic variants). I guess it's possible, though - maybe the folks who don't have it are running a specific Vista build or version?

Posted

Why even use an external exe for something so simple, instead of the Terminate method of the Win32_Process class? (fully documented on MSDN and all, just google it). Unless that doesn't work in a HTA (can't say I bothered trying).

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...