executing system commands without the command prompt popping up

This is a discussion on executing system commands without the command prompt popping up within the C++ Programming forums, part of the General Programming Boards category; I'm trying to write this program for school that stops kids from making batch files. I know the sys admin ...

  1. #1
    Registered User deltabird's Avatar
    Join Date
    Jan 2003
    Posts
    73

    executing system commands without the command prompt popping up

    I'm trying to write this program for school that stops kids from making batch files. I know the sys admin can restrict these computers if they wanted to but this is in a special room where the comps are used for too many things to restrict things on.

    So anyhow, I wrote a program that minimizes itself to the system tray and keeps on deleting *.bat in a certain directory. Don't worry, I'm not deleting any need files lol.

    But when you use the system() function in windows.h, a command prompt box pops up and sort of renders the program useless because every second the cmd box comes up.

    I know there are programs that somehow execute system commands, but I can't figure out how to do it without the cmd window popping up.

    Any help will be appreciated.

  2. #2
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    dont use system. treat it as if it doesnt exist. For windows you could use the api func DeleteFile() . details on msdn
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 03-30-2009, 12:25 AM
  2. System(); commands
    By Ryan in forum C++ Programming
    Replies: 15
    Last Post: 03-15-2002, 06:05 PM
  3. system commands
    By mervin in forum C Programming
    Replies: 3
    Last Post: 02-03-2002, 08:01 AM
  4. string variables and system commands part 2
    By Unregistered in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 10-25-2001, 12:57 AM
  5. string variables in system commands
    By Unregistered in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 10-24-2001, 12:36 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21