Kill command and the shell command
Kill command and the shell command
(OP)
i was wondering about the kill and shell command. some one told me that they could be used for creating very weak viruses. i was wondering if that was true and what other uses you could have for the kill command
RE: Kill command and the shell command
As for the "kill" command; you should use it to clean up temporary files that your program may use for workspace and are no longer needed. I believe file attributes and 'file doesn't exist' would cause errors to a Kill statement.
For further help and samples, you should look at the QB help file. On a blank line in QB, just type KILL then move the cursor inside the word and press F1. The same goes for "SHELL".
--MiggyD
RE: Kill command and the shell command
SHELL sends whatever parameter you give it to the command line and runs it.
In DOS:
C:\ > copy c:\file.tmp a:\file.tmp
In Qbasic
SHELL "copy c:\file.tmp a:\file.tmp"
are the same thing, it gives you a way of using DOS commands in qbasic.
KILL deletes a file, as said above, it does the same thing as SHELL "del ..."
RE: Kill command and the shell command
If you intend to keep you account on this site, I kindly suggest that you refrain from asking questions like this one, as 90% of people that get red flagged lose their account. It is a pretty touchy subject.
RE: Kill command and the shell command
RE: Kill command and the shell command
RE: Kill command and the shell command
If you scan the source and you see KILL "C:\" WITHOUT a specified path then the answer is "yes, the coder has bad intentions."
She/He is tring to delete the root directory (or necessary operating system files). What the coder should do is use specified paths to his/her own temporary files/directory such as KILL "C:\MYProg\TEMP\*.tmp".
I would recommend you should:
1) ask the coder why that is in there -- it is possible they wrote it too quickly and/or forgot to specify the path.
2) (if no response to #1) warn others (or site mgmt) of the possible dangers.
-AND-
3) do NOT!! run the program and delete it from your computer.
--MiggyD