Lost Password?

Go Back   CodeCall Programming Forum > Software Development > C and C++

C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-11-2008, 10:11 AM
telboon telboon is offline
Newbie
 
Join Date: May 2008
Posts: 6
Rep Power: 0
telboon is on a distinguished road
Default How to get rid of command window?

I've been trying to do some stuff like copying files and changing attributes of files using C++.

However, there's a irritating command window which pops up and goes away in a split second whenever I use system(command).

For example:
Code:
system("copy .\\test.exe /B C:\\test.exe /B");
However, as I mentioned above, a command window will pop up, and goes away in a split second.

For copying of files, I can probably use the manual method of copying using file manipulation in binary mode, but I do not know other alternatives for changing attributes of files.

So, can you guys offer me a solution? Is there another function in C++ that changes attributes of files, or is there a way to stop the command window from popping up?

Thanks in advance!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 05-11-2008, 11:09 AM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Age: 26
Posts: 4,856
Last Blog:
Zend Studio for Eclips...
Rep Power: 20
Jordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud of
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default Re: How to get rid of command window?

Nope, I believe you will need to read the contents of the file and then write them to the destination file manually in order to copy a file with out the command prompt showing. If you are using .NET you can use the file.copy function.
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog
Don't hesitate to ask any questions that you have! Check out our ASCII Calculator!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-11-2008, 11:14 AM
telboon telboon is offline
Newbie
 
Join Date: May 2008
Posts: 6
Rep Power: 0
telboon is on a distinguished road
Default Re: How to get rid of command window?

Ya, i can do that for copying, but I also need to change attributes.

I'm not using .NET. My compiler is Dev-C++.

You guys know any better free ones for windows? I can't afford .NET, just a poor high school student here.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-11-2008, 12:06 PM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: London, England
Posts: 3,471
Last Blog:
Web slideshow in JavaS...
Rep Power: 30
Xav is a name known to allXav is a name known to allXav is a name known to allXav is a name known to allXav is a name known to allXav is a name known to all
Send a message via MSN to Xav
Default Re: How to get rid of command window?

.NET is free. Maybe you misunderstand what it is:

@ You write programs in C++ .NET, perhaps using Microsoft's Visual Studio 2008 Express Editions (available free from Visual Studio 2008 Express Editions).

@ You compile the programs as .NET programs and distribute them.

@ When the user runs it, they must have the .NET Framework installed (also free).

.NET is not a compiler - it is a framework. In other words, when the program runs, it relies on the framework to run it. The framework provides lots of really helpful classes, such as System.IO.File, which can do everything with files, and really easily, too.

The compiler used, from Visual Studio 2008 Express Editions, is both free and comprehensive. Give it a try!

Oh, and I know what you mean - I'm 12 years old.
__________________
Xav, the power of youth
Worship the Creator... not his creations
Web Site | Beta Site
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 05-12-2008, 02:04 AM
telboon telboon is offline
Newbie
 
Join Date: May 2008
Posts: 6
Rep Power: 0
telboon is on a distinguished road
Default Re: How to get rid of command window?

Oh, ok, i get what .NET is.

Anyway, I found the functions I need in WIN32 API already.

So, for a .NET program, it requires the user to have the platform too, isn't it quite troublesome? What benefits does it have over WIN32 API or other default libraries?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 05-12-2008, 07:05 AM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: London, England
Posts: 3,471
Last Blog:
Web slideshow in JavaS...
Rep Power: 30
Xav is a name known to allXav is a name known to allXav is a name known to allXav is a name known to allXav is a name known to allXav is a name known to all
Send a message via MSN to Xav
Default Re: How to get rid of command window?

You can set it up so that when the user runs the setup.exe file to install it, it downloads and installs the .NET Framework automatically. However, it is only Windows-compatible.
__________________
Xav, the power of youth
Worship the Creator... not his creations
Web Site | Beta Site
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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


All times are GMT -5. The time now is 10:29 AM.

Contest Stats

Xav ........ 164.00000
dargueta ........ 128.00000
John ........ 127.00000
gaylo565 ........ 18.00000
XaNaX ........ 15.00000
Johnnyboy ........ 3.00000
navghost ........ 1.00000

Contest Rules

Ads