Search found 70 matches

by mfm4aa
19 Feb 2013 12:43
Forum: DOS Batch Forum
Topic: Last User Posted on Forum
Replies: 9
Views: 7383

Re: Last User Posted on Forum

You should put

Code: Select all

SETLOCAL EnableDelayedExpansion
outside the loop. I got a stack overflow.
by mfm4aa
19 Feb 2013 06:42
Forum: DOS Batch Forum
Topic: Ver check & install
Replies: 16
Views: 12052

Re: Ver check & install

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...
by mfm4aa
19 Feb 2013 00:43
Forum: DOS Batch Forum
Topic: ? on batch file not working
Replies: 9
Views: 9019

Re: ? on batch file not working

The value of "%~tX" depends on your local system settings. Usually the accuracy is set to minutes, not to seconds. Imo it can't be set to seconds.
by mfm4aa
15 Feb 2013 15:15
Forum: DOS Batch Forum
Topic: Find Multiple Strings
Replies: 29
Views: 19842

Re: Find Multiple Strings

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...
by mfm4aa
14 Feb 2013 09:07
Forum: DOS Batch Forum
Topic: [solved]One batch file, two computers, two different results
Replies: 12
Views: 8108

Re: [solved]One batch file, two computers, two different res

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...
by mfm4aa
14 Feb 2013 02:39
Forum: DOS Batch Forum
Topic: [solved]One batch file, two computers, two different results
Replies: 12
Views: 8108

Re: One batch file, two computers, two different results

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-...
by mfm4aa
14 Feb 2013 00:59
Forum: DOS Batch Forum
Topic: [solved]One batch file, two computers, two different results
Replies: 12
Views: 8108

Re: One batch file, two computers, two different results

I get this from my system:

Code: Select all

C:\Test>echo %date%
14.02.2013

C:\Test>date /t
14.02.2013


Is there no way to get the day of week in pure batch?
by mfm4aa
13 Feb 2013 16:30
Forum: DOS Batch Forum
Topic: suppress blinking cursor in a cmd -file
Replies: 4
Views: 7241

Re: suppress blinking cursor in a cmd -file

1) ? (imo:no)
2) "mode 80,25" look here
3) maybe in the system control settings
by mfm4aa
13 Feb 2013 15:56
Forum: DOS Batch Forum
Topic: Find Multiple Strings
Replies: 29
Views: 19842

Re: Find Multiple Strings

& 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...
by mfm4aa
13 Feb 2013 14:48
Forum: DOS Batch Forum
Topic: Find Multiple Strings
Replies: 29
Views: 19842

Re: Find Multiple Strings

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:...