|
Answer» did you call the batch file by name from the command line with the filename in quote marks?
try this
set name=%~n1 mkdir "%name%its not work with double click ... its not work with call from cmd (batch file )did you do all these?
1. save the batch as fmake.bat in the same folder 2. Open a dos command box in that folder. 3. If the text file is called (for example) sample.txt you type
fmake "sample.txt"
thx a lot of i wanted this (My Progress 30%) but we have a problem , i want that if i run fmake (in cmd like above POST) it automatically CREATE sample folder ... in above way i must type manually ... im waitig for your answer is there just 1 file in the folder?no but there 1 txt fileonly ever 1 text file, and that is the file whose name you want to use for the folder name
for example
find example9999.txt ===>>> make folder example9999
Is this the task? yeah, exactlytry this, run it in the same directory
@echo off setlocal enabledelayedexpansion for /f "delims==" %%F in ('dir/b *.txt') do ( echo found text file: %%F make folder called : %%~nF md %%~nF pause
i copied the code in batch file in same directory with a txt file ... then run the batch file but not any happendI missed a space and a character out. Sorry.
@echo off setlocal enabledelayedexpansion for /f "delims==" %%F in ('dir /b *.txt') do ( echo found text file: %%F make folder called : %%~nF md %%~nF )
pause Mistakes HOPEFULLY corrected!
Quote @echo off setlocal enabledelayedexpansion for /f "delims==" %%F in ('dir /b *.txt') do ( echo found text file : %%F echo will make folder : %%~nF if not exist "%%~nF" md "%%~nF" ) pause
ohh very thx .. we victory on dos ! but plz see this ? can u REMOVE some bugs? use my corrected version
delete folder called g
try again
ok thx for help me , im writting a program , for some problem i had changed my method ... but i will return to old method ... now my progress is over 60% if i encounter problem i will come back ... ThX in advance dear friend
|