CppMonster
CppMonster

Reputation: 1296

Batch script, error Windows cannot find

I've got following code:

set sciezka = "%~dp0"
echo %sciezka%
pushd
c:
cd %sciezka%
cd
if exist %sciezka%Data goto nocreate1
mkdir %sciezka%Data
:nocreate1
if exist %sciezka%Data\Results goto nocreate2
mkdir %sciezka%Data\Results
:nocreate2

start %sciezka%script.py %1%
if not exist %sciezka%BoostedFeedManager.exe goto nomove
move %sciezka%BoostedFeedManager.exe %sciezka%Data
:nomove

start %sciezka%Data\BoostedFeedManager.exe %sciezka%Data\configInstruments.json
:end
popd

pause

After execute it I've got error "Windows cannot find script.py and BoostedFeedManager.exe"

While executing script there's displaying command set sciezka..., but 'cd' displaying empty path. What is wrong with this script?

Upvotes: 1

Views: 140

Answers (1)

R1cky
R1cky

Reputation: 753

Seems that variable sciezka is not being defined by your very first command/line set sciezka = "%~dp0".

From what I've just tested if you will change that to set "sciezka=%~dp0" it should do the work for the issue you're descirbing

Also rather put path in cd %sciezka% into double quotes cd "%sciezka%" to avoid issues with spaces in path name.

Hope this helps, let me know if not or any further issue

Upvotes: 1

Related Questions