kill bat works, want to add line to restart w/high priority

magicJack Tips and Tricks

Moderators: Pilot, Bill Smith

Post Reply
TreasureGift
MagicJack User
Posts: 39
Joined: Wed Apr 16, 2008 3:24 am
Location: On a mountain side in the high desert of far West Texas
Contact:

kill bat works, want to add line to restart w/high priority

Post by TreasureGift »

I have gotten so much help here, I just want to thank everyone for all the contributions!

Now, on to my question. I use the kill bat to stop MJ, I would like to add a line that restarts MJ with high priority, I want it to be all in one batch file, not have to run 2 separate ones, I have experimented a bit but haven't gotten anywhere. Anyone care to help? Any suggestions (or just the actual line I need to type would be appreciated).

Here is what I have tried:

taskkill /F /IM MagicJack.exe
start /high /F /IM MagicJack.exe

It stops MJ, but doesn't restart it at all. I am using Vista.

Thanks,
Wretha
read about my adventures living 100% off grid
http://wretha.blogspot.com
omega10x
magicJack Apprentice
Posts: 16
Joined: Wed May 07, 2008 4:58 pm

Re: kill bat works, want to add line to restart w/high prior

Post by omega10x »

TreasureGift wrote:I have gotten so much help here, I just want to thank everyone for all the contributions!

Now, on to my question. I use the kill bat to stop MJ, I would like to add a line that restarts MJ with high priority, I want it to be all in one batch file, not have to run 2 separate ones, I have experimented a bit but haven't gotten anywhere. Anyone care to help? Any suggestions (or just the actual line I need to type would be appreciated).

Here is what I have tried:

taskkill /F /IM MagicJack.exe
start /high /F /IM MagicJack.exe

It stops MJ, but doesn't restart it at all. I am using Vista.

Thanks,
Luckly most commands work the same as the did in windows xp and 2k..

for the Taskkill Command the /F - essentually means forcekill and /im - defines the target ...
but the start command works a little diffrent

the start command goes
Start "App.exe" /priority

start doesnt even reconize the /F or /IM commands


so try


taskkill /F /IM MagicJack.exe
start MagicJack.exe /HIGH

or to start MagicJack Minimized

taskkill /F /IM MagicJack.exe
start MagicJack.exe /HIGH /MIN

***Note*** i have found most programs are very unstable running in any priority other than normal. Atleast the user interface, so your softphone may not run correctly if you start it in high priority

A better solution might be to kill the autorun/autostart of the magicjack and run it as a service,
services are tipically higher priorty to begin with, in addition, they tipically run fairly stable if you set the to high priorty, but then you wouldnt have easy access to your softphone .. just an idea
TreasureGift
MagicJack User
Posts: 39
Joined: Wed Apr 16, 2008 3:24 am
Location: On a mountain side in the high desert of far West Texas
Contact:

Post by TreasureGift »

OK. still working on it, adding start MagicJack.exe /HIGH does not work, just trying to run MJ from MagicJack.exe will not work, it just doesn't start anything, it only seems to run from the one called magicjackloader.exe. so I did some searching here and found the way to make MJ run without having to use the loader, you basically create a shortcut of magicjack.exe, and replace the target with the following:



start C:\Users\TreasureGift\AppData\Roaming\mjusbsp\magicJack.exe /foreground /scf _magicJackPersonalDataRoot "G:\magicJack"

Now, I can add that to the kill bat file, it looks like this:

taskkill /F /IM MagicJack.exe
start C:\Users\TreasureGift\AppData\Roaming\mjusbsp\magicJack.exe /foreground /scf _magicJackPersonalDataRoot "G:\magicJack"

It works great, it will kill MJ and restart it again without the loader running. I still want to restart it with high priority, so I added /high at the end of the second line:

taskkill /F /IM MagicJack.exe
start C:\Users\TreasureGift\AppData\Roaming\mjusbsp\magicJack.exe /foreground /scf _magicJackPersonalDataRoot "G:\magicJack" /high


, when I run that, it gives me an error:

Invalid key high specified
Do you want to open SJphone command line parameters reference?


If I choose yes, it says:

Cannot open the file:
C:\Users\TreasureGift\AppData\Roaming\mjusbsp\SJphone.chm::/sjphonecommandlineswitches.htm.



OK. now what? I have tried adding /high to the target on the shortcut to run MJ, that doesn't work either. I'm getting closer, I know it! 8)
Wretha
read about my adventures living 100% off grid
http://wretha.blogspot.com
TreasureGift
MagicJack User
Posts: 39
Joined: Wed Apr 16, 2008 3:24 am
Location: On a mountain side in the high desert of far West Texas
Contact:

Post by TreasureGift »

Anyone??? :?:
Wretha
read about my adventures living 100% off grid
http://wretha.blogspot.com
hotman
magicJack Apprentice
Posts: 20
Joined: Mon Apr 28, 2008 12:07 pm

Post by hotman »

Try this It will work for you
create a batch file and put this in there.

start /High magicjack.exe

You can replace /High with any of these switches below.
/Low /BelowNormal /Normal /AboveNormal /High /RealTime "DO NOT ADD MORE THEN ONE SWITCH"
TreasureGift
MagicJack User
Posts: 39
Joined: Wed Apr 16, 2008 3:24 am
Location: On a mountain side in the high desert of far West Texas
Contact:

Post by TreasureGift »

Thanks for the suggestion Hotman, but that doesn't work, you cannot run magicjack.exe as it is, it will do nothing. The ONLY way to get magicjack.exe to run in a bat file is to do this start C:\Users\TreasureGift\AppData\Roaming\mjusbsp\magicJack.exe /scf _magicJackPersonalDataRoot "G:\magicJack", I have tried to add /high in many places, so far none of them work, here is what I have tried so far:

taskkill /F /IM MagicJack.exe
start /high C:\Users\TreasureGift\AppData\Roaming\mjusbsp\magicJack.exe /scf _magicJackPersonalDataRoot "G:\magicJack"

taskkill /F /IM MagicJack.exe
start C:\Users\TreasureGift\AppData\Roaming\mjusbsp\magicJack.exe /high /scf _magicJackPersonalDataRoot "G:\magicJack"

taskkill /F /IM MagicJack.exe
start C:\Users\TreasureGift\AppData\Roaming\mjusbsp\magicJack.exe /scf _magicJackPersonalDataRoot "G:\magicJack" /high

taskkill /F /IM MagicJack.exe
start C:\Users\TreasureGift\AppData\Roaming\mjusbsp\magicJack.exe /scf _magicJackPersonalDataRoot "start /high G:\magicJack"


So far none of these work, what now? If someone has some advice (that has actually worked for them), I would appreciate it very much. :)
Wretha
read about my adventures living 100% off grid
http://wretha.blogspot.com
stroths
Dan isn't smart enough to hire me
Posts: 470
Joined: Wed Apr 02, 2008 11:45 pm
Location: Dallas, TX

Post by stroths »

You could use a program like Process Lasso to set the priority.
TreasureGift
MagicJack User
Posts: 39
Joined: Wed Apr 16, 2008 3:24 am
Location: On a mountain side in the high desert of far West Texas
Contact:

Post by TreasureGift »

Thanks Stroths, I gave it a try, it works, I still would like to add start/high to my batch file to make it load with high priority, I don't have that much ram on my computer, 512 meg, (I know, I should get more, maybe someday...) I would rather not have to run another program to make this one program load high. It would be easier (and use less memory on my computer) if I could just add /high somewhere in the bat file.
Wretha
read about my adventures living 100% off grid
http://wretha.blogspot.com
sbw07
MagicJack Contributor
Posts: 74
Joined: Tue Jan 01, 2008 4:19 pm

Post by sbw07 »

TreasureGift wrote:Thanks for the suggestion Hotman, but that doesn't work, you cannot run magicjack.exe as it is, it will do nothing. The ONLY way to get magicjack.exe to run in a bat file is to do this start C:\Users\TreasureGift\AppData\Roaming\mjusbsp\magicJack.exe /scf _magicJackPersonalDataRoot "G:\magicJack", I have tried to add /high in many places, so far none of them work, here is what I have tried so far:

taskkill /F /IM MagicJack.exe...

....

......


So far none of these work, what now? If someone has some advice (that has actually worked for them), I would appreciate it very much. :)
Here's what worked for me:

Code: Select all

taskkill /f /IM magicjack.exe
cmd.exe /c start "runhigh" /high "C:\Users\YourUserName\AppData\Roaming\mjusbsp\magicJack.exe" /foreground /scf _magicJackPersonalDataRoot "G:\magicJack"
It has to be ran as an Administrator.
Last edited by sbw07 on Wed Jan 07, 2009 4:40 pm, edited 1 time in total.
Image mj on Vista Home Premium SP1
dz20854
magicJack Apprentice
Posts: 25
Joined: Mon Oct 13, 2008 10:23 am

Post by dz20854 »

Where do you put this code?
TreasureGift
MagicJack User
Posts: 39
Joined: Wed Apr 16, 2008 3:24 am
Location: On a mountain side in the high desert of far West Texas
Contact:

Post by TreasureGift »

dz20854 wrote:Where do you put this code?
You make a batch file (bat file), the way you do that is to create a text file, copy the code, save it, change the file extension from .txt to .bat

it will give you a warning asking you if you really want to do it, just say yes, now you have a bat file.

I keep mine on my desktop.

Just to update, I use Process Lasso now (thanks stroths for the info on that program), it takes care of the problem, I make MJ run high instead of normal, it helps a little.
Wretha
read about my adventures living 100% off grid
http://wretha.blogspot.com
dz20854
magicJack Apprentice
Posts: 25
Joined: Mon Oct 13, 2008 10:23 am

Post by dz20854 »

Do I put this .bat file in startup?
TreasureGift
MagicJack User
Posts: 39
Joined: Wed Apr 16, 2008 3:24 am
Location: On a mountain side in the high desert of far West Texas
Contact:

Post by TreasureGift »

dz20854 wrote:Do I put this .bat file in startup?
I have the bat file on my desktop (not in the startup), I don't keep my Magic Jack plugged in all the time, I just plug it in when I want to use it.

I don't know what other people do with theirs.
Wretha
read about my adventures living 100% off grid
http://wretha.blogspot.com
sbw07
MagicJack Contributor
Posts: 74
Joined: Tue Jan 01, 2008 4:19 pm

Post by sbw07 »

dz20854 wrote:Do I put this .bat file in startup?
If you want mj to start with your PC, then go right ahead. (Make sure to remove the startup entries created by mj.)
Image mj on Vista Home Premium SP1
Post Reply