Jesse Posted November 15, 2010 Share Posted November 15, 2010 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 More sharing options...
Jesse Posted November 15, 2010 Author Share Posted November 15, 2010 Link to comment Share on other sites More sharing options...
ECF Posted November 15, 2010 Share Posted November 15, 2010 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 More sharing options...
dimitrifrom31 Posted November 15, 2010 Share Posted November 15, 2010 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 More sharing options...
Jesse Posted November 15, 2010 Author Share Posted November 15, 2010 No luck, appreciate that tho! Maybe the 2 batch file idea where when one runs and the last command is to overwrite the file with the other file so each time they get called they switch contents? Link to comment Share on other sites More sharing options...
dimitrifrom31 Posted November 15, 2010 Share Posted November 15, 2010 cd "C:\Program Files (x86)\Windows Sidebar" TASKKILL /F /IM sidebar.exe if not errorlevel 1 goto end START sidebar.exe :end Link to comment Share on other sites More sharing options...
Jesse Posted November 15, 2010 Author Share Posted November 15, 2010 It didn't work but when I change START sidebar.exe to CALL sidebar.exe It worked! So thanks for that code. Now how might I go about not making the command prompt to show up on the screen nor in the taskbar? Link to comment Share on other sites More sharing options...
dimitrifrom31 Posted November 15, 2010 Share Posted November 15, 2010 start /min myfile.bat in another .bat of course edit : it will run minimized but not hidden, thats not possible afaik. Link to comment Share on other sites More sharing options...
Jesse Posted November 15, 2010 Author Share Posted November 15, 2010 I've got that going, just wasnt sure if we could remove it from showing up at all. What would be the code to close the box once it has opened - it doesnt close? Link to comment Share on other sites More sharing options...
ECF Posted November 15, 2010 Share Posted November 15, 2010 If it is a command box then you you can simply put the exit command at the end of the batch file which closes the commandline box. Link to comment Share on other sites More sharing options...
Jesse Posted November 15, 2010 Author Share Posted November 15, 2010 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 More sharing options...
Jesse Posted November 17, 2010 Author Share Posted November 17, 2010 So windows sign + g brings Sidebar to the foreground. I found this program to create a shortcut to hide it. http://www.howtogeek.com/geekers/VistaSidebarHider.zip Now, if there was someway to simulate keystrokes in a batch file I could create that toggle instead of having 2 buttons set to use those two-stroke hotkeys. Link to comment Share on other sites More sharing options...
ECF Posted November 17, 2010 Share Posted November 17, 2010 You may be able to do everything with this. http://www.autoitscript.com/autoit3/index.shtml Link to comment Share on other sites More sharing options...
Jesse Posted November 17, 2010 Author Share Posted November 17, 2010 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.