I know you can use string manipulation in DOS like this:
echo %TIME%
echo %TIME:~0,2%
echo %TIME: =0%
The output of these three commands would be:
8:36:05.60
8
08:36:12.93
I want to know how to combine the second and third lines to get this output:
08
I can’t use set to temporarily store a value because I want to use this string in a command line argument.
In pure DOS, you do not have nested statements.
Unless your application (for which the argument is) is a console app, you will not have a console to parse your environment variables (in the run box, try notepad c:\%TIME:~0,2%.txt and see what happens).
If it is a console app, then you would be able to use env vars, but no parsing, which is handled by cmd itself.
So you are bound to launch your app with a cmd.exe or a batch file and you can use all the expressions you need with SETs between.