Witam ,jak w c++/cmd wrócić do poprzedniej ścieżki ??
edddit:::::
napisałem taki kod i oto to nie działa
po linijce system("cd in"); ścieżka powinna się zmienić na:
C:\Users\user\Desktop\path\in
ale skoro nie to po linijce system("cd ..");
powinno ścieżka powinna się zmienić na
C:\Users\user\Desktop
#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
system("cd in");
system("dir");
system("pause");
system("cd ..");
system("dir");
return 0;
}
Volume in drive C is Windows
Volume Serial Number is D2EC-D90E
Directory of C:\Users\user\Desktop\path
02.02.2019 13:10 <DIR> .
02.02.2019 13:10 <DIR> ..
02.02.2019 12:58 <DIR> bin
02.02.2019 13:02 <DIR> in
02.02.2019 13:10 210 main.cpp
02.02.2019 12:58 <DIR> obj
02.02.2019 12:44 1 097 path.cbp
02.02.2019 13:06 116 path.depend
3 File(s) 1 423 bytes
5 Dir(s) 864 903 860 224 bytes free
Press any key to continue . . .
Volume in drive C is Windows
Volume Serial Number is D2EC-D90E
Directory of C:\Users\user\Desktop\path
02.02.2019 13:10 <DIR> .
02.02.2019 13:10 <DIR> ..
02.02.2019 12:58 <DIR> bin
02.02.2019 13:02 <DIR> in
02.02.2019 13:10 210 main.cpp
02.02.2019 12:58 <DIR> obj
02.02.2019 12:44 1 097 path.cbp
02.02.2019 13:06 116 path.depend
3 File(s) 1 423 bytes
5 Dir(s) 864 903 860 224 bytes free
Process returned 0 (0x0) execution time : 5.453 s
Press any key to continue.