Version check without Basic: @echo off for /f "tokens=2*skip=4" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Flash Player Plugin" /v DisplayVersion') do echo %%b for /f "tokens=2*skip=4" %%a in ('reg query "HKLM\SOFTWARE\Micros...
Strip file path & file name from full path, see also the code by abc0502 e.g. set "commandline=C:\Windows\System32\smss.exe" for %%i in ("%commandline%") do set "fpath=%%~dpi" &set "fname=%%~nxi" echo %fpath% # %fname% Output: C:\WINDOWS\system32\ # sm...
Antonio posted some pure batch solutions over on StackOverFlow. The last one looks to be pure batch and independent of the regional settings. m This "date<nul" trick is not independent of the local settings, e.g. C:\Test>for /f "tokens=*skip=4" %a in ('reg query "HKCU\Contr...
I guess you could calculate how many days it has been since 1980-01-01 and figure out which day it is from that. But imo there is no safe way to get a valid current date without the help of external programs. The user can set %date% to whatever he wants, e.g. "14.02.2013 Thu" or "02-...
& with a temp file: @echo off &setlocal set "fname=PidDb.txt" set "tname=%temp%\~" for /f "usebackqtokens=1-3" %%i in ("%fname%") do ( if "%%i"=="Image" <nul set /p=%%k:>>"%tname%" if "%%i"=="PID:" >>&q...
Other suggestion: @echo off &setlocal enabledelayedexpansion set "fname=PidDb.txt" set /a cnt=0 for /f "usebackqtokens=1-3" %%i in ("%fname%") do ( if "%%i"=="Image" ( set /a cnt+=1 set "$image!cnt!=%%k" ) if "%%i"=="PID:...