I am calling some batch file commands from my program. The first two ommands say Improper Syntax but the last one works.![]()
EDIT:Code:#include <iostream> #include <fstream> #include <stdio.h> #include <stdlib.h> using namespace std; char Item[3][80]; void Title() { cout << endl; cout << "TrainSim Object Installer" << endl; cout << "--------------------------------" << endl << endl; } void Convert(char *RouteName) { cout << endl << endl; sprintf(Item[0], "copy *.s \"c:\\Program Files\\Microsoft Games\\Train Simulator\\Routes\\%s\\Shapes\\*.*\"", RouteName); sprintf(Item[1], "copy *.sd \"c:\\Program Files\\Microsoft Games\\Train Simulator\\Routes\\%s\\Shapes\\*.*\"", RouteName); sprintf(Item[2], "copy *.ace \"c:\\Program Files\\Microsoft Games\\Train Simulator\\Routes\\%s\\Textures\\*.*\"", RouteName); } void CopyShapesAndTextures(char *RouteName) { system(Item[0]); system(Item[1]); system(Item[2]); } int main() { char RouteName[50]; Title(); cout << "Whats the name of the target route? "; cin.get(RouteName, 50).get(); cout << endl; cout << RouteName; Convert(RouteName); CopyShapesAndTextures(RouteName); //EditREF(RouteName); cin.get(); return 0; }
Also if I input a "RouteName" with a space in it. (My Route) It says cannot find path.



LinkBack URL
About LinkBacks



