Batch file help need an example I don't know how to do this without using a rename if i could get some help i would greatly appreciate it the question is........
Many operating systems use the file command RENAME or MOVE to allow users to give a new name to an existing file. Suppose that in Windows Command Line, neither of these commands was available. Write a simple batch file that uses a combination of other existing commands that would perform the same function as RENAME/MOVE and explain your decision. Your batch file must be able to handle any filename provided to it by the user.
hint: prompt for names
use COPY and DEL
=====================================
Life is too important to be taken seriously.M2
Below is a snippet from a bat that gets input and converts it to Morse code.
Your input might be ren junk.txt good.txt
or ren drive\ folder\ file ext example ren c:\stuff\junk.txt stuff.dat
Then call or run test bat.You could also start a test.bat and test.txt and add the following code at the end
***************************test.bat******************
cls
:start
set INPUT=
set /P INPUT=Type input: %=%
echo Your input was: %INPUT%
pause
echo %INPUT% >>temp.txt:final
setlocal enabledelayedexpansion
set FINAL=
for /f %%a in (temp.txt) do (
set FINAL=!FINAL!%%a
)
echo %FINAL% >final.txt
endlocal
ren final.txt test.bat
test.bat
******************************temp.txt*******************
ren (type alt 255 after ren)
************************************************************Without the final your input to the file will be
ren
c:\stuff\my.txt mystuff.datrather than ren C:\stuff\my.txt mystuff.dat
Just some thoughts....................If you cannot use rename try a linux program
You got me mystified.
=====================================
Life is too important to be taken seriously.M2
My thought was.
Build a batch file in parts.
Then insert the users input.
................temp.bat..............
cls
@ echo off
echo for /f "delims==" %%F in ('dir /b /s *. >>temp.bat
echo set /P INPUT=Type input: %=%
echo Your input was: %INPUT%
pause
echo %INPUT% >>temp.batYou would need to finalize it as it will come out as
for /f "delims==" %%F in ('dir /b /s *.
your inputinstead of for /f "delims==" %%F in ('dir /b /s *.your input
What does morse code have to do with rename or move?
=====================================
Life is too important to be taken seriously.M2
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |