1.

Solve : %dd% specs?

Answer» <html><body><p>Could I put something like "if %dd%==monday goto :MONDAY" or would it be different?I just checked for you:<br/><br/>?"if %dd%==monday goto :MONDAY"="if %dd%==monday goto :MONDAY"<br/>True<br/><br/>They are the same. Of course really I have no <a href="https://interviewquestions.tuteehub.com/tag/idea-770073" style="font-weight:bold;" target="_blank" title="Click to know more about IDEA">IDEA</a> what your talking about or what %dd% is. Also you don't need to use the Colon in a goto, just for the label.Isn't %dd% to get the day? I've used that before. <a href="https://interviewquestions.tuteehub.com/tag/quote-1175222" style="font-weight:bold;" target="_blank" title="Click to know more about QUOTE">QUOTE</a> from: tommyroyall on February 25, <a href="https://interviewquestions.tuteehub.com/tag/2010-290294" style="font-weight:bold;" target="_blank" title="Click to know more about 2010">2010</a>, 04:51:10 PM</p><blockquote>Isn't %dd% to get the day? I've used that before.<br/></blockquote> <br/><br/>C:\batch&gt;type  tezt.bat<br/> Code: <a>[Select]</a>echo off<br/>FOR /F "TOKENS=1* DELIMS= " %%A IN ('date /t') DO (<br/>SET CDATE=%%B<br/>echo CDATE=%CDATE%<br/>)<br/>pause<br/><br/>FOR /F "TOKENS=1,2 eol=/ DELIMS=/" %%A IN ('echo %CDATE%') DO (<br/>SET mm=%%A<br/>echo mm=%mm%<br/>)<br/>pause<br/><br/>FOR /F "TOKENS=1,2 DELIMS=/ eol=/" %%A IN ('echo %CDATE%') DO (<br/>SET dd=%%B<br/>echo dd=%dd%<br/>)<br/>FOR /F "TOKENS=2,3 DELIMS=/" %%A IN ('echo %CDATE%') DO (<br/>SET yyyy=%%B<br/>SET date=%mm%%dd%%yyyy%<br/>echo date=%date%<br/>)<br/><strong>Output:</strong><br/><br/>C:\batch&gt;tezt.bat<br/><br/>CDATE=02/25/2010<br/>Press any key to continue . . .<br/>mm=02<br/>Press any key to continue . . .<br/>dd=25<br/>date=02252010<br/><br/>C:\batch&gt; Quote from: tommyroyall on February 24, 2010, 07:37:24 PM<blockquote>Could I put something like "if %dd%==monday goto :MONDAY" or would it be different?<br/></blockquote> <br/><br/>C:\batch&gt;type  tommy.bat<br/> Code: <a>[Select]</a>echo off<br/><br/>set dd=%date:~0,3%<br/>echo dd=%dd%<br/><br/>if %dd%==Mon goto monday<br/>echo Today is not monday<br/>goto eof<br/><br/>:monday<br/><br/>echo Hello Monday<br/>pause<br/><br/>:eof<br/><strong>Output:</strong><br/><br/>C:\batch&gt;tommy.bat<br/>dd=Mon<br/>Hello Monday<br/>Press any key to continue . . .<br/>C:\batch&gt;<br/><br/><strong>Output:</strong><br/><br/>C:\batch&gt;tommy.bat<br/>dd=Thu<br/>Today is not monday<br/><br/>C:\batch&gt;<br/><br/><a href="http://www.dostips.com/DtTipsStringManipulation.php">http://www.dostips.com/DtTipsStringManipulation.php</a><br/></body></html>


Discussion

No Comment Found