Search found 70 matches

by mfm4aa
18 Mar 2013 08:38
Forum: DOS Batch Forum
Topic: Problem with script
Replies: 5
Views: 4473

Re: Problem with script

Hi, you can use somewhat like this:

Code: Select all

@echo off &setlocal
set "test=test.txt"
:loop
:: wait 2 seconds
ping -n 3 localhost>nul
:: check if the file is ready, loop if not
copy /b %test%+nul %test% >nul 2>&1||goto :loop
endlocal
by mfm4aa
17 Mar 2013 10:00
Forum: DOS Batch Forum
Topic: Once again problem with a batch file.
Replies: 21
Views: 13693

Re: Once again problem with a batch file.

Why do you use "set didauthcheck=false"?
by mfm4aa
17 Mar 2013 05:37
Forum: DOS Batch Forum
Topic: catch error only 1 week old
Replies: 11
Views: 7699

Re: catch error only 1 week old

Date and time calculation depends on the local format settings in the system control panel. So you should also provide the output of the command 'echo %date%'.
by mfm4aa
15 Mar 2013 16:39
Forum: DOS Batch Forum
Topic: dos command prompt for producing sound
Replies: 14
Views: 24421

Re: dos command prompt for producing sound

There is no DOS command making noise.
by mfm4aa
15 Mar 2013 03:48
Forum: DOS Batch Forum
Topic: no found record print out "no record found"
Replies: 6
Views: 4830

Re: no found record print out "no record found"

or use the ERRORLEVEL function:

Code: Select all

findstr "ORA-[0-9]" alert_OCEAN_test.log
If ERRORLEVEL 1 echo NO ERROR FOUND>>%output%


This catches all errorlevels above zero.
by mfm4aa
14 Mar 2013 10:14
Forum: DOS Batch Forum
Topic: Need Batch Script - New Question
Replies: 47
Views: 37397

Re: Need Batch Script - New Question

At first list the folders with the 'dir' command, then delete them with 'rd'. You can't list already deleted folders.
by mfm4aa
14 Mar 2013 03:11
Forum: DOS Batch Forum
Topic: how to print out the error mesaage that is around the oraErr
Replies: 23
Views: 16180

Re: how to print out the error mesaage that is around the or

The two codes lead to the same result. I don't know, where the problem is.
by mfm4aa
14 Mar 2013 02:49
Forum: DOS Batch Forum
Topic: how to print out the error mesaage that is around the oraErr
Replies: 23
Views: 16180

Re: how to print out the error mesaage that is around the or

Try this (change the name of the input file): @echo off &setlocal enabledelayedexpansion for /f "delims=" %%i in (test.txt) do ( set "ftime=%%i" if "!ftime:SST=!" neq "!ftime!" set "stime=%%i" if "!ftime:ORA-=!" neq "!ftime!" ...
by mfm4aa
13 Mar 2013 09:31
Forum: DOS Batch Forum
Topic: Registry key to find installation directory
Replies: 3
Views: 3223

Re: Registry key to find installation directory

You can use somewhat like this on the command line (if 'DisplayName' is the name of the installed program): for /f "tokens=2*" %i in ('reg query "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\DisplayName" /v "InstallLocation"^|find "REG_SZ&...
by mfm4aa
08 Mar 2013 16:32
Forum: DOS Batch Forum
Topic: subroutine
Replies: 6
Views: 5102

Re: subroutine

":eof" is a built in label. It means "end of file" and "goto :eof" works similar to "exit /b". The subroutine gives control back to the main programme.
by mfm4aa
08 Mar 2013 13:38
Forum: DOS Batch Forum
Topic: subroutine
Replies: 6
Views: 5102

Re: subroutine

Yes, better without "call":

Code: Select all

@echo off &setlocal
for /f "delims=" %%i in (tmp1.txt) do echo %%~dpi %%~nxi %%~atzi KB
endlocal



.. or on the command line:

Code: Select all

for /f "delims=" %i in (tmp1.txt) do @echo %~dpi %~nxi %~atzi KB

by mfm4aa
08 Mar 2013 13:25
Forum: DOS Batch Forum
Topic: subroutine
Replies: 6
Views: 5102

Re: subroutine

You need delimiters: @echo off &setlocal for /f "delims=" %%i in (tmp1.txt) do call :subroutine "%%~i" goto :eof :subroutine for %%i in ("%~1") do set "fpath=%%~dpi"&set "fname=%%~nxi"&set "finfo=%%~atzi" echo %fpath% %fname% %f...
by mfm4aa
08 Mar 2013 12:00
Forum: DOS Batch Forum
Topic: working with for loops /tokens
Replies: 3
Views: 3449

Re: working with for loops /tokens

What is "%%h"? If you start with "%%i", the next for loop variable name is "%%j".
by mfm4aa
07 Mar 2013 14:51
Forum: DOS Batch Forum
Topic: I please need help to delet writing protection with batch
Replies: 4
Views: 3538

Re: I please need help to delet writing protection with batc

You should use the "attrib" command for this:

Code: Select all

attrib -r "C:\Users\Sr. Test\Desktop\Berichts/Pflegedokumentation geschützt.doc"


Type "attrib /?" for help.