
-----------------------------------
Wolf_Destiny
Mon Sep 11, 2006 8:28 pm

Turing ++ &gt; 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 tasklist : boolean
%Lists all the currently running processes,
%   closes quickly however, and may need to be used in an actual command prompt
%Returns true if successful, false if not
killtask (task:string) : boolean
%Immediately forces the task with Image Name (task) to close
%Returns true if successful, false if not
shutdown (timer : int, message : string) : boolean
%Counts down "timer" seconds displaying "message" until finally shutting down the computer
%Returns true if successful, false if not
reboot (timer : int, message : string) : boolean
%Counts down "timer" seconds displaying "message" until finally rebooting the computer
%Returns true if successful, false if not
stop_shutdown : boolean
%Immediately stops a shutdown/reboot currently counting down
%Returns true if successful, false if not

Using taskkill: (Refer to the bit about finding the Image Name)
How does taskkill -F -IM 
So to close firefox immediately:
taskkill -F -IM firefox.exe
7. Put that line into a Sys.Exec Structure.
if Sys.Exec ("taskkill -F -IM firefox.exe") then
put "This program just closed firefox, how d'ya like that?"
end if

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
 tells the command prompt what the heck you want to close
So instead of running:
if Sys.Exec ("taskkill -F -IM firefox.exe") then
put "This program just closed firefox, how d'ya like that?"
end if
You can now use:
if killtask ("firefox.exe") then
put "This program just closed firefox, how d'ya like that?"
end if
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!