![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Web Design & Programming Discussion of web design, and server-side & client-side scripting |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
Registered User
Join Date: Jul 2008
Posts: 62
OS: Windows 7 Beta, Windows Vista Home Premium SP1, Windows XP Pro SP3, Windows 2000 Pro SP4
|
C++ program
Alright. So, I'm writing a small program (runs in a command line interface) to do a variety of tasks, including accessing batch files in sub-directories. The program is meant to be run from a CD-Rom, which contains a number of sub-directories. One such sub-directory contains my batch files (the reason for this is to keep the CD-Rom image from becoming cluttered). My question now is, does anybody know how I can execute this task of calling a batch file from a sub-directory? The command I am using right now works only for batch files that are in the same directory as the main application. The command is as follows:
if (go == 3){ system("go.bat"); break; } I want to (for instance) run this batch file from a sub-directory simply called "Batch". If anyone has any idea how to complete this, I would greatly appreciate any help you could give me. Thanks. |
|
|
|
| Important Information |
|
Join the #1 Tech Support Forum Today - It's Totally Free!
TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free. Join TechSupportforum.com Today - Click Here |
|
|
#2 (permalink) |
|
Design Team Member
Join Date: Jul 2007
Location: Coventry, UK
Posts: 1,887
OS: Vista, various linux distros
|
Re: C++ program
Can you use the full path?
Apparently, you use double forward/back-slashes as a folder seperator... e.g. Code:
system("Batch//go.bat");
Jamey |
|
|
|
|
|
#3 (permalink) |
|
Registered User
Join Date: Jul 2008
Posts: 62
OS: Windows 7 Beta, Windows Vista Home Premium SP1, Windows XP Pro SP3, Windows 2000 Pro SP4
|
Re: C++ program
Thanks for your help, but i've figured it out (and it works)... the resulting
code is as follows (for anyone that cares): Code:
system("Batch\\go.bat");
|
|
|
|
![]() |
| Thread Tools | |
|
|