cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Running bat files
Running bat files
Oct 24, 2013 at 4:51am UTC
supersammy7000
(24)
I want to know if you can run bat files from code? If so how else how can you shutdown a computer with code? OS is windows 7.
Last edited on
Oct 24, 2013 at 4:56am UTC
Oct 24, 2013 at 5:04am UTC
giblit
(3750)
Yes you can run external programs within your program. Also there are several ways to shutdown the computer using c++.
http://msdn.microsoft.com/en-us/library/windows/desktop/aa376868(v=vs.85).aspx
Oct 24, 2013 at 8:32am UTC
tajendra
(48)
Rightly mentioned by giblit here is one way to call the bat files from the code:-
>> using system call.
http://www.cplusplus.com/reference/cstdlib/system/
Here is the details of shutdown command
>>
http://pcsupport.about.com/od/commandlinereference/p/shutdown-command.htm
One referring article to it :-
>>
http://tajendrasengar.blogspot.in/2013/10/running-bat-file-from-c-source-code.html
Last edited on
Oct 24, 2013 at 8:51am UTC
Topic archived. No new replies allowed.