Page 1 of 1
Why do I get "The system cannot find the path specified." ?
Posted: 26 Jan 2015 20:49
by Haxs4Life
I am a noob an beginner at DOS coding so please don't complain or make fun of my bad a sloppy/messy code :/ but could anyone tell me why im getting this? My file download is below from filedropper.com. But baisicly i want the program to be looking into different folders throughout the program..but so far i've only been able to make it look within the folder its allready in, i cant get it to back up and look in different folders :/
Example code:
Code: Select all
set "Files=Files\"
set "Data=Files\Data"
set "Accounts=Files\Accounts"
set "CH=Chapters\" (This is in the Main folder with the Files folder)
:Data
cd "%Data%"
(Do some actions within this folder)
:Account Creation
cd "%Files%"
md "Accounts"
Problem: It would create the "Accounts" folder in the "Files\Data" directory path instead of the "Files" folder i want it in. Anyone know how to fix this or another way i can do this that will work how i want it to?
File Download:
http://www.filedropper.com/os_3
Re: Why do I get "The system cannot find the path specified.
Posted: 27 Jan 2015 09:02
by penpen
I think you are searching for:
Code: Select all
set "Files=Files\"
set "Data=Files\Data"
set "Accounts=Files\Accounts"
set "CH=Chapters\" (This is in the Main folder with the Files folder)
:Data
pushd "%Data%"
(Do some actions within this folder)
popd
:Account Creation
md "%Files%\Accounts"
penpen
Re: Why do I get "The system cannot find the path specified.
Posted: 02 Feb 2015 11:09
by Samir
Haxs4Life wrote:I am a noob an beginner at DOS coding so please don't complain or make fun of my bad a sloppy/messy code :/ but could anyone tell me why im getting this? My file download is below from filedropper.com. But baisicly i want the program to be looking into different folders throughout the program..but so far i've only been able to make it look within the folder its allready in, i cant get it to back up and look in different folders :/
Example code:
Code: Select all
set "Files=Files\"
set "Data=Files\Data"
set "Accounts=Files\Accounts"
set "CH=Chapters\" (This is in the Main folder with the Files folder)
:Data
cd "%Data%"
(Do some actions within this folder)
:Account Creation
cd "%Files%"
md "Accounts"
Problem: It would create the "Accounts" folder in the "Files\Data" directory path instead of the "Files" folder i want it in. Anyone know how to fix this or another way i can do this that will work how i want it to?
File Download:
http://www.filedropper.com/os_3
You haven't used the set command correctly to set the variables before you can use them.
Re: Why do I get "The system cannot find the path specified.
Posted: 02 Feb 2015 16:22
by foxidrive
This should do what you have indicated that you need to do.
Code: Select all
set "Data=d:\Chapters\Files\Data"
set "Accounts=d:\Chapters\Files\Accounts"
md "%data%" 2>nul
md "%Accounts%" 2>nul
:Data
pushd "%Data%"
(Do some actions within this folder)
popd
:Account Creation
pushd "%Accounts%"
(Do some actions within this folder)
popd
The
cd /d command is also a way to change directory.
The exact answer to a problem depends on the exact question...
Re: Why do I get "The system cannot find the path specified.
Posted: 03 Feb 2015 06:13
by Samir
Samir wrote:You haven't used the set command correctly to set the variables before you can use them.
I doubled-checked this and quotes are allowed like this. My mistake.