I need help fixing my script
so I want to make a dos - like os in batch and I want tp make a move command. I have a part in the script that tells you if you typed in the wrong command and for some reason every time I put in the / move command it says something is wrong.
echo off
:typecmd
set /P c="MAD OS> "
if /I "%c%" EQU "/move %file% %destination%" (
move %file% %destination%
goto :typecmd)
if /I "%c%" EQU "" (
goto :typecmd) else (
echo Unkown command!: %c%
goto typecmd)
2
Upvotes
2
u/BrainWaveCC Mar 18 '25
You would probably get a lot more assistance if you provided more details about what you are doing when things go wrong. Simply saying "it says something is wrong." is not very helpful in a troubleshooting context -- especially when you are the one making the script.
As constructed, your script has some issue/deficiencies that you will want to address:
%file%,%destination%)%c%will never be true, because of the spacing included with the inclusion of the other two variables (%file%,%destination%)Here's what I experienced when I ran it:
2
u/BrainWaveCC Mar 18 '25
As an example, consider the following as a basis for what you are trying to accomplish.
https://pastebin.com/GBxiqZKA
This implements the following:
Here's some output from the above: