Page 1 of 1
{green}If not exist folders goto create folder and start bat
Posted: 27 Mar 2012 11:46
by mazius123
Hey, i want to know how can i check if there is folders ../sameexample and sameexmaple and if not exist create one sameexmaple and move the batch file int that folder and run it ...? or exist and run start example.bat (only once )
Re: {green}If not exist folders goto create folder and start
Posted: 27 Mar 2012 14:37
by dbenham
Huh
I cannot understand what you are trying to do. And what is with {green} in the title?
Dave Benham
Re: {green}If not exist folders goto create folder and start
Posted: 27 Mar 2012 14:56
by abc0502

I don't understand too!
what do u mean with move the batch file. what batch file! and what is example.bat !
and dbenham
i think he mean the MR.Green Smiles when he wrote {green}
Huh

Re: {green}If not exist folders goto create folder and start
Posted: 27 Mar 2012 15:18
by aGerman
All I understood is that he probably needs to know where the batch file is currently placed. This may help:
Code: Select all
@echo off &setlocal
echo Me: %~f0
echo My path: %~dp0
echo My name: %~nx0
for /f "delims=" %%i in ("%~dp0.") do echo My folder: %%~nxi
for /f "delims=" %%i in ("%~dp0..") do echo My parent folder: %%~nxi
pause
Regards
aGerman