Jarrod13
Programmer
- Dec 18, 2008
- 12
I'm trying to use the system command to change the current directory:
My root directory is c:\qa1.0, When I run the following code I'm setting the DIRECTORY variable to "c:\qa1.0\Pass"
The system command is not recognizing the DIRECTORY variable.
When DIRECTORY is printed out, the correct path is printed however when chdir is run it displays "c:\qa1.0" (NOT c:\qa1.0\Pass)
When I type in the manual path into the system function:
it works correctly.
Any ideas?
My root directory is c:\qa1.0, When I run the following code I'm setting the DIRECTORY variable to "c:\qa1.0\Pass"
The system command is not recognizing the DIRECTORY variable.
Code:
print("Please enter the directory you wish to change to:");
getline DIRECTORY < "-";
print(DIRECTORY);
system("cd " DIRECTORY);
print("This is the current directory: ");
system("chdir");
When DIRECTORY is printed out, the correct path is printed however when chdir is run it displays "c:\qa1.0" (NOT c:\qa1.0\Pass)
When I type in the manual path into the system function:
Code:
system("cd c:\qa1.0\Pass")
Any ideas?