Jump to content

I need your Bat Skills


Jesse

Recommended Posts

I'm making a toggle button on my G110 for the Windows 7 Sidebar.

 

To turn on:

START "C:\Program Files (x86)\Windows Sidebar\sidebar.exe"

 

To turn off:

TASKKILL /F /IM sidebar.exe

 

How can i write the batch file so it changes functions once used (a simple toggle button)? I'm not familiar with anything other than the basic basic commands.

 

Thanks for any help.

Link to comment
Share on other sites

You would need to do some coding to get this to work as a toggle button.

 

But a shortcut would be to create 2 batch files. One that turns the sidebar on and one that turns the sidebar off. Then simply create desktop icons which link to both and name them "on" and "off" or something like that.

 

You can then just run which one you like.

Link to comment
Share on other sites

I'm making a toggle button on my G110 for the Windows 7 Sidebar.

 

To turn on:

START "C:\Program Files (x86)\Windows Sidebar\sidebar.exe"

 

To turn off:

TASKKILL /F /IM sidebar.exe

 

How can i write the batch file so it changes functions once used (a simple toggle button)? I'm not familiar with anything other than the basic basic commands.

 

Thanks for any help.

 

try that :

 

TASKKILL /F /IM sidebar.exe
!if errorlevel 1 goto end
START "C:\Program Files (x86)\Windows Sidebar\sidebar.exe" 
:end

Link to comment
Share on other sites

Had to add EXIT before and after I guess

EXIT
:end
EXIT

 

Only little bug left is when I double click the shortcut icon to start this whole process it works perfectly and the window doesn't even show up in the taskbar, but when I use the shortcut key on my keyboard that is using the same shortcut I'm double clicking on the desktop the box does show up. Any ideas?

Link to comment
Share on other sites

I think because I have gotten rid of the need to close / start the program I actually needed the function to have a way to minimize it. I guess I'm going to figure out if there is another way to minimize it without that program adding another windows shortcut key or any need for a program.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Who's Online   0 Members, 0 Anonymous, 16 Guests (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use