Search found 1769 matches

by penpen
22 Mar 2020 06:31
Forum: DOS Batch Forum
Topic: Win10: Move cursor position to 0,0
Replies: 4
Views: 204

Re: Win10: Move cursor position to 0,0

The codes we used before(timeout 1 > con) moved cursor position to 1,0 So you should have used a script to lift the cursor position up one line to move the cursor to 0,0 In his first post in the topic (that i linked above) Antonio used: for /F %%a in ('timeout /T 1 ^> CON') do rem (If i remember ri...
by penpen
21 Mar 2020 18:20
Forum: DOS Batch Forum
Topic: Using Double Pipe in IF command
Replies: 5
Views: 193

Re: Using Double Pipe in IF command

Also, FOR /F %A IN ('"ECHO WOW"') DO (TIMEOUT 1 && ECHO WOW || ECHO OHH) Worked. I don't see any reason for the for-loop of that command, just use pure conditional-chaining ("&&") and conditional-execution operator ("||"): TIMEOUT 1 && ECHO WOW || ECHO OHH I'm also not fully sure how that for-loop ...
by penpen
21 Mar 2020 17:55
Forum: DOS Batch Forum
Topic: Win10: Move cursor position to 0,0
Replies: 4
Views: 204

Re: Win10: Move cursor position to 0,0

Antonio did something like that before using Windows 8.1:
viewtopic.php?f=3&t=6760
by penpen
20 Mar 2020 07:57
Forum: DOS Batch Forum
Topic: 8191 buffer limit: Different Windows 10 builds behave differently
Replies: 5
Views: 169

Re: 8191 buffer limit: Different Windows 10 builds behave differently

I didn't run into changing behavior on the same machine yet Just try (win10) a batch file with many AT-characters ('@') (varies depending on machine) and an internal command. On my machine when using 3053 AT's and set-command the console window crashes (that happens all the time) after it may or ma...
by penpen
20 Mar 2020 05:56
Forum: DOS Batch Forum
Topic: 8191 buffer limit: Different Windows 10 builds behave differently
Replies: 5
Views: 169

Re: 8191 buffer limit: Different Windows 10 builds behave differently

I'm curious what the behavior is with XP (or any other version). Windows XP pro, 32 bit, Version 5.1.2600, just terminates the execution of the batch ater the first performed test (same behaviour for all tests): ----------------------------------------------- :test1 Die eingegebene Zeile ist zu lan...
by penpen
19 Mar 2020 17:39
Forum: DOS Batch Forum
Topic: Using Double Pipe in IF command
Replies: 5
Views: 193

Re: Using Double Pipe in IF command

I don't think, that WiVi71 tries to use the conditional-execution operator "||" as a conditional-OR operator. @WiVi71 In all the examples you gave, you have used the character COMMA (','). That character is a delimiter and must be escaped, so the following might help you: IF . EQU ^, DISM || ECHO PO...
by penpen
18 Mar 2020 12:14
Forum: DOS Batch Forum
Topic: WEVTUTIL CL fails if the event log channel has a space in it
Replies: 2
Views: 182

Re: WEVTUTIL CL fails if the event log channel has a space in it

If you don't use any arguments in your "for/f"-loop, then the default setting is used, which is the first token (for more, see "for/?" - without the doublequotes).
This might help you:

Code: Select all

for /f "usebackq tokens=* delims=" %%a in ("C:\LOGLIST.TXT") do WEVTUTIL CL "%%a"
penpen
by penpen
03 Mar 2020 14:52
Forum: DOS Batch Forum
Topic: Archive a subfolder and delete it
Replies: 1
Views: 949

Re: Archive a subfolder and delete it

I've tried a code but it makes a global archive of every subfolderToArchiveX :/ Nice and beautiful code - i guess. And, i need to archive these subfolder only if they're older than 30 days You could copy all files you need to a temporary folder and archive that one, or you could create an archive w...
by penpen
23 Feb 2020 09:38
Forum: DOS Batch Forum
Topic: execute simple cmd line hidden without file
Replies: 12
Views: 2651

Re: execute simple cmd line hidden without file

mshta "javascript:document.write('<html><script language=\"VBScript\">Set objShell = WScript.CreateObject(\"WScript.Shell\") : objShell.Run(\"cmd.exe /c calc.exe\"), 0, True</script></html>');close()" The jscript in hta doesn't seem to support the "WScript" object (if that code worked for you, then...
by penpen
21 Feb 2020 16:34
Forum: DOS Batch Forum
Topic: execute simple cmd line hidden without file
Replies: 12
Views: 2651

Re: execute simple cmd line hidden without file

From command line you could use something like that: "C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe" "-Command" "$wshShell = New-Object -ComObject WScript.Shell; $result = $WshShell.Run(\"C:\WINDOWS\system32\cmd.exe /cecho Hello world!^&pause\", 1, $true);" This test line should open a c...
by penpen
21 Feb 2020 15:16
Forum: DOS Batch Forum
Topic: copy folder with latest time stamp using batch file
Replies: 3
Views: 1871

Re: copy folder with latest time stamp using batch file

it copied over the contents inside the "test" folder. I would like to copy over the "test" folder and the sub folders inside it. I am a little bit confused, you said before, you only wanted to copy the sub-folder with the latest timestamp (at least i interpreted it that way): that will detect the f...
by penpen
20 Feb 2020 13:57
Forum: DOS Batch Forum
Topic: copy folder with latest time stamp using batch file
Replies: 3
Views: 1871

Re: copy folder with latest time stamp using batch file

You might want to use xcopy instead of copy (if i remember right; better check first):

Code: Select all

xcopy "!newest!" "%dest%" /E
penpen
by penpen
20 Feb 2020 13:13
Forum: DOS Batch Forum
Topic: Bring some characrets from a .txt and "tidy" them
Replies: 1
Views: 1683

Re: Bring some characrets from a .txt and "tidy" them

You might want to use a for/f-loop to split the parts of the date: @echo off setlocal enableExtensions enableDelayedExpansion set "input=20/02/2020 " for /f "tokens=1-3 delims=/ " %%a in ("%input%") do set "timestamp=%%~c%%~b%%~a" echo("%timestamp%" goto :eof Note that dates are localized strings an...
by penpen
20 Feb 2020 13:06
Forum: DOS Batch Forum
Topic: Easy way to check tokens 5-16 and delete if specified pattern?
Replies: 4
Views: 2033

Re: Easy way to check tokens 5-16 and delete if specified pattern?

We don't know exactly how those numbers are generated and most probably they are IEEE 754 numbers where you might get "inf", "+inf", "-inf" or "NaN" as well. To not miss such lines i would use something like the following (untested): call jrepl "^[^,]*(,[^,]*){3}(,\x22\x22|,'#MISSING'){12}.*" "" /R ...
by penpen
20 Feb 2020 06:07
Forum: DOS Batch Forum
Topic: .Bat Change priority process several times
Replies: 7
Views: 2706

Re: .Bat Change priority process several times

This might help you (just because you are here for the first time and i felt like it, but usually you have to try more than that): @echo off setlocal enableExtensions enableDelayedExpansion :: use the existing of a file as a signal set "signal=signal.tmp.txt" >"%signal%" rem: :: delete file after 2 ...