Making a button with MS-DOS commands

I am trying to make a button with the following commands:

:: DATE SETTINGS @ECHO off SETLOCAL ENABLEEXTENSIONS if "%date%A" LSS "A" (set toks=1-3) else (set toks=2-4) for /f "tokens=2-4 delims=(-)" %%a in ('echo:^|date') do ( for /f "tokens=%toks% delims=.-/ " %%i in ('date/t') do ( set '%%a'=%%i set '%%b'=%%j set '%%c'=%%k)) if %'yy'% LSS 100 set 'yy'=20%'yy'% set Today=%'yy'%-%'mm'%-%'dd'% ENDLOCAL & SET v_year=%'yy'%& SET v_month=%'mm'%& SET v_day=%'dd'% :: ECHO Today is Year: [%V_Year%] Month: [%V_Month%] Day: [%V_Day%] ::------------------------------------------------------------------------------------------------ ::AskForFolderName set /p NewFolder=Enter folder name here: If [%NewFolder%]==[] Goto AskForFolderName If Exist "%NewFolder%" ( Echo Folder already exists Echo. Goto AskForFolderName ) ::------------------------------------------------------------------------------------------------ MD "%V_Year%.%V_Month%.%V_Day% - %NewFolder%\IMAGES\RAW IMAGES" MD "%V_Year%.%V_Month%.%V_Day% - %NewFolder%\IMAGES\EXPORTS\JPG" MD "%V_Year%.%V_Month%.%V_Day% - %NewFolder%\IMAGES\EXPORTS\PNG" MD "%V_Year%.%V_Month%.%V_Day% - %NewFolder%\IMAGES\EXPORTS\PSD" MD "%V_Year%.%V_Month%.%V_Day% - %NewFolder%\VIDEO\RAW VIDEO" MD "%V_Year%.%V_Month%.%V_Day% - %NewFolder%\VIDEO\EDITS" MD "%V_Year%.%V_Month%.%V_Day% - %NewFolder%\VIDEO\EXPORTS"

If I paste the commands in the button and run it all I get is the command prompt flashing once and then closes. As far as I know Dopus allows MSDOS batch syntax so I really don't know what is wrong here. If I paste the same commands in CMD or a batch file it works fine. Please help me out here.

Add @externalonly as the first line, so that Opus knows you want to use the MS-DOS Set command rather than the internal Opus Set command.

(You won't be able to call any internal Opus commands then, but it doesn't look like you're doing that, and you wouldn't want to with MS-DOS conditional logic anyway, since calling internal commands splits things into multiple batch files. If you do ever want variables, conditional logic, etc. mixed with internal commands, scripting is the best way to go.)

Thanks leo. This works nicely. I was actually inspired by one of your tutorials where you made multiple folders with one button. The only reason why I made a batch file in DOS was because I wasn't sure if I could make a folder with the current date and make a prompt asking for folder name with Dopus commands.

You can prompt using things like {dlgstring}. Scripts can do more advanced prompting.

Please link your account if you need detailed examples.