Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Kill command and the shell command

Kill command and the shell command

Kill command and the shell command

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

"Could" is the operative word here; but this site will not condone the creations of those malicious programs.

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".


RE: Kill command and the shell command

Do you remember the days of MS-DOS?  Where you had to type commands into the command prompt, well it's still there, it's justmasked by windows.
SHELL sends whatever parameter you give it to the command line and runs it.

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

Qbasic can be used to create slight more complex bat files so to speak.  You can do loops and comparisons easier.  And as you can make a really lame bat file virus, you can use the dos commands through qbasic to do the same.   
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

sorry about the bad question but i was just wondering as i have seen many examples and programs about this topic that never work for the programmer. I wasnt actualy trying to create a virus. I like to know about these kind of things just in case i ever actualy need to know or need to look out for a bad program(ie. qb4all has a couple of programs with the command KILL "C:/" in them). Thanks for the info and im sorry if i offended you.

RE: Kill command and the shell command

If they are used correctly they won't damage your computer.  I usually use them to delete tmp files that my programs create.  I doubt that programs that you find on qb4all are viruses.  

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.
    3) do NOT!! run the program and delete it from your computer.


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close