Saved Bookmarks
| 1. |
Solve : Places utility with variables? |
|
Answer» Quote from: Squashman on June 30, 2012, 04:48:29 PM It would be really great if you could actually shows us the output of this following from the command prompt. The screenshot with the command line [year+ old attachment deleted by admin]I'll for your advice after revising the screenshots Best Regards There is no need to post screen shots for the output of the CMD line or batch files. You can copy and paste the text from the cmd window into the forums. Posting an image just consumes more resources.this should work in spanish but if there is an option to put the month in three letter version then change jan feb mar, etc to the spanish version in the script below: @echo off&SetLocal EnableDelayedExpansion&goto :start :GetDate [EnVar] echo.GetDate [EnVar] Sets date into environment variable, EnVar as: dd-mm-aaaa echo.Usage: GetDate dma^&set ymd=%%errorlevel%%, ^(use %% rather than ^^! in command line) echo.Usage: GetDate dma^&set ymd=^^!errorlevel^^!, ^(use ^^! rather than %% in script^) echo.If no argument passed it echo's the date in dd-mm-aaaa format echo.Returns aaaammdd in errorlevel regardless if Envar is passed as argument or not echo.Works on NT/2K/XP/Vista/Win7 machines independent of most regional date settings EndLocal&exit /b :start set P1=%~1&if /i "!p1!" equ "/?" goto :GetDate if /i "%date%A" lss "A" (set toks=1-3) else (set toks=2-4) for /f "skip=1 tokens=2-4 delims=(-)" %%a in ('date^ for /f "tokens=%toks% delims=.-/ " %%d in ('date/t') do ( set %%a=%%d&set %%b=%%e&set "%%c=%%f" ) ) if /i "%mm:~0,1%" gtr "9" CALL :month_convert mm if /i 1%mm% lss 20 set "mm=0%mm%" if /i %aa% lss 100 set "aa=20%aa%" if defined p1 ( Endlocal call set "%~1=%dd%-%mm%-%aa%"&exit /b %yy%%mm%%aa% ) EndLocal&echo.%dd%-%mm%-%aa%&exit /b %yy%%mm%%dd% :month_convert set "months=Jan Feb Mar Apr May Jun Jul Aug Sep Oct NOV Dec" call set "month=%%%~1%%" set/a mnum=0 for %%m in (%months%) do set/a mnum+=1&if /i %month% equ %%m call set "%~1=!mnum!"&exit /bQuote from: carlsomo on July 08, 2012, 11:37:30 PM this should work in spanish but if there is an option to put the month in three letter version then change jan feb mar, etc to the spanish version in the script below: I'll try . Best Regards |
|