Computer Science Canada Turing ++ > Predefs to add functionality [Windows] |
Author: | Wolf_Destiny [ Mon Sep 11, 2006 8:28 pm ] | ||||||||||||||||||||||
Post subject: | Turing ++ > Predefs to add functionality [Windows] | ||||||||||||||||||||||
Before I begin, the commands included in the predef file are only tested on Windows XP Pro, I'm not saying that they won't work on other systems, but I don't know whether or not other systems will support the DOS commands used. (If you test all the commands on a different platform, please list the ones that work/don't work, and your platform so that I can try to find equivelants) What I've done: I've created a new predef .tu file to start blending the functionality of Windows commands into an easy to use Turing Command set. We all know that with Sys.Exec you can carry out any DOS command right? Most people also know that you can run files with their default programs by putting them into Sys.Exec...but what about when you're done with them? How do you close them? "With the mouse duh". Okay so how does TURING close them? I've outlined how to shutdown the computer, reboot it, list running programs, and close any given program on this help thread. But isn't there an easier way? Now there is. I hope for this to become an ever expanding - cross platform predef file, as I find and add functionality to it. I'm also planning on making an updater for it, if I update frequently. ->If you don't know how to add a predef file, don't worry I'm detailing how to do that later. What does the file do so far? Version 1.0.1 - First Release Note: To stay independant of the Sys file, it includes it's own private use Execute command for accessing the command.com
Using taskkill: (Refer to the bit about finding the Image Name) Quote: How does [killtask] work?
First off, you need to know what's called the "image name", that the program runs under. Example firefox's image name is "firefox.exe" it's simply, but neccessary. So to do this: 1. Open your program of choice (the one that Turing will close). 2. Start Menu -> Run -> Command [enter] 3. Type: "tasklist" (no quotes) and press enter. 4. Scroll around looking under the first heading (image name) until you find your program. 5. Write down the image name somewhere. 6. Then substitute the image name into this code:
So to close firefox immediately:
7. Put that line into a Sys.Exec Structure.
A closer look: -F tells the command prompt to force the program to close -IM tells the command prompt that the image name is to follow <imagenamehere> tells the command prompt what the heck you want to close So instead of running:
You can now use:
No more syntax additions! I hope I've explained how it works sufficiently, but if you have any questions, post and ask! I'll be happy to answer them. Also any suggestions for additions to the project are also welcomed, as I'm at a bit of a loss now... ==========Adding a new Predef File!========== If you already know how to do this, you could at least benefit from the ability to copy and paste. ->Download to come, don't worry!<- 1. First off, download the .tu file. 2. Put it in your "Turing\Support\Predefs\" folder. 3. Open the file "Predefs.lst" in any text editer. 4. Scroll to the bottom. 5. Add these lines to the end EXACTLY AS IS:
6. The /*%ADDED%*/ bit can be taken out, but if it doesn't work, this works as a label to tell you what to remove! 7. Save the file. NOT Save as, just save. (Prevents the text editer from adding it's own file type) 8. Test the new commands! They're done! They're in! ==========Download Section========== Rapidshare Link: Click Here Try to primarily use the rapidshare link, if the file is no longer there, PM me and I'll repost it. If it isn't working for you, feel free to use the compsci link below. The file isn't zipped as it is so small. This way you can save it directly to the predef folder. |
Author: | Wolf_Destiny [ Mon Sep 11, 2006 8:36 pm ] | ||
Post subject: | If... | ||
If neither of the downloads work for you, or you think this is easier, here is the source code for the file "WIN_XP.tu" (This also justifies this post being in "Source Code") >MAKE SURE you give it the right name!!
Enjoy! ~Wolf_Destiny |