473,407 Members | 2,315 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

How to use Windows command-line commands in code

175 100+
In Windows, if you open a command prompt, there are a bunch of keywords like, 'chdir', 'copy', ...

What I'm trying to figure out is how to use that COPY command in c++ code. I want to use the COPY command with the options (/a, /b, ...).

How do I do this?

Every time I search for this on Google, the results are no where close to what I'm looking for. Any help is appreciated.
Sep 18 '12 #1

✓ answered by weaknessforcats

Can you not just call system()?

3 1725
weaknessforcats
9,208 Expert Mod 8TB
Can you not just call system()?
Sep 18 '12 #2
manontheedge
175 100+
Ugh, yeah, that would be what I'm looking for. I apparently was trying to complicate things. Thank you.
Sep 18 '12 #3
Banfa
9,065 Expert Mod 8TB
Of course you could always call the WIN32 API function CopyFile.

I personally would consider calling system to run a command that had a WIN32 API equivalent poor practice.
Sep 18 '12 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: farshad | last post by:
Hello, Could someone tell me which way can we use windows command(for example Create New Folder) in visual c++ programing or use dos command without using dos prompt. best regards farshad
4
by: Claudio Grondi | last post by:
I need to unpack on a Windows 2000 machine some Wikipedia media .tar archives which are compressed with TAR 1.14 (support for long file names and maybe some other features) . It seems, that...
6
by: sri2097 | last post by:
Hi, I'm trying to zip a particular fiolder and place the zipped folder into a target folder using python. I have used the following command in 'ubuntu'. zip_command = 'zip -qr %s %s' % (target,...
4
by: Ernesto | last post by:
I'm trying to launch a seperate telnet window from within my python program. The command I thought I was supposed to use is below: os.system("telnet.exe -f C:\Folder\output.txt localhost 6000")...
2
by: jake_allen_no_spam | last post by:
Hi All How do you run an external windows command in Microsoft Access. I have a VBA script and I want to start internet explorer from within Access. Is there a run host command to start a...
0
by: seth.northrop | last post by:
Hi, I'm in the process of developing a script in Windows where I need to use exec/system. Whenever I execute either, Windows spawns a command window which automatically disappears. Is there a...
0
by: questionit | last post by:
Hellow Experts Does anyone know of a windows .exe command that is used to resolve driver conflicts in Windows This command i have used a long time ago . It could be run in RUN as well. After it...
1
by: pramodkh | last post by:
Dear All, I am writting a PERL script in windows to test some test cases. The test result is captured both in command prompt and in the log file. But when the result is displayed on a windows...
20
by: Alexey Kulentsov | last post by:
Hi all! Windows XP, Apache 2.2, PHP 5.2.5 as apache module (php5apache2_2.dll) I need to run background process and see output but for current moment all methods runs it as process not as...
0
by: tvnaidu | last post by:
Porting windows app to Linux, can I replace windows "_mkdir" with system("mkdir") in Linux?. system("mkdir(...)");
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.