Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 12-08-2008, 12:55 PM   #1 (permalink)
Right Off the Assembly Line
 
Join Date: Aug 2008
Posts: 2
Exclamation system command c/c++


//dont run from the ide make a .exe file of the program by compiling it n then make n then run from the exe file


#include <stdlib.h>
#include <stdio.h>
#include<io.h>

int main(void)
{
printf("About to spawn command interpreter and run a DOS command\n");
//create a file named 1.txt
creatnew("1.txt",0);
//make the file hidden
system("attrib +h 1.txt");
//i now need to delete the file named 1.txt and its hidden
//so i type in dos del 1.txt /a:h
system("del 1.txt /a:h");

//system return error invalid switch /a
//works fine system("del 1.txt");
return 0;
}

//i need to delete a hidden file using c/c++ help me...
internet.sid is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 12-08-2008, 05:20 PM   #2 (permalink)
"The RaCaLaNGeL"©
 
romeo_8693's Avatar
 
Join Date: Dec 2005
Location: Goa/Pune
Posts: 389
Default Re: system command c/c++

remove the ":"
__________________
Without sorrows happiness would be boring!
romeo_8693 is offline  
Old 17-08-2008, 09:56 PM   #3 (permalink)
Right Off the Assembly Line
 
Join Date: Aug 2008
Posts: 2
Default Re: system command c/c++

its the same doesnt wanna take any switches...
internet.sid is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run Command pvsraao Hardware Q&A 2 22-11-2007 12:11 AM
command in Red Hat ? speedster Open Source 6 04-06-2007 01:52 PM
COMMAND & CONQUER UPDATE - EA shoots out Command & Conquer 3 demo techtronic Gamerz 1 28-02-2007 12:18 PM
Dos Command Needed....... satyamy Software Q&A 6 04-10-2006 12:37 PM
recycle bin through dos command kin.vachhani QnA (read only) 6 08-03-2006 10:54 PM

 
Latest Threads
- by Sujeet
- by clmlbx
- by Sujeet
- by icebags

Advertisement




All times are GMT +5.5. The time now is 11:09 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2