Search found 1724 matches

by penpen
21 Jan 2020 14:42
Forum: DOS Batch Forum
Topic: Explain batch script - need some help
Replies: 2
Views: 46

Re: Explain batch script - need some help

If i remember right, then ... You list your pc's routing table using: NETSH INTERFACE IPv4 SHOW ROUTE The pipe "^|" redirects the output to a find command to filter the (unique) entry of the default IPv4-Prefix "0.0.0.0/0" (== the range of IP addresses from 0.0.0.0 to 255.255.255.255 == all possible...
by penpen
18 Jan 2020 04:47
Forum: DOS Batch Forum
Topic: If/Else in 1 line--only do something from Else statement
Replies: 6
Views: 113

Re: If/Else in 1 line--only do something from Else statement

What is the best coding form in writing this If/Else statement on 1 line? That depends on how you define the term "best coding" (the fastest, the easiest to read, the most beautiful to read, ...) and what exactly you want to change (that part "(echo OK)" only, ..., all). For example you could use: ...
by penpen
14 Jan 2020 03:57
Forum: DOS Batch Forum
Topic: Blockout (3d Tetris) !
Replies: 13
Views: 3546

Re: Blockout (3d Tetris) !

Although that actually is offtopic (this is not the Blockout of California Dreams from 1989), i left it here to be understand as a
suggestion to misol101 on how to further develope his implementation of that game.

penpen
by penpen
14 Jan 2020 03:41
Forum: DOS Batch Forum
Topic: Redirect text to a file (runas command result)
Replies: 13
Views: 209

Re: Redirect text to a file (runas command result)

I actually can't test if redirecting is possible with runas at all, but if it were then i assume you need both streams (stdio and stderr); untested:

Code: Select all

echo.|((runas /user:administrator echo %date%" 2>&1) >"test.txt")
penpen
by penpen
11 Jan 2020 13:39
Forum: DOS Batch Forum
Topic: Edit and Save and XML with a Batch Script
Replies: 2
Views: 149

Re: Edit and Save and XML with a Batch Script

You could use a bat-jscript hybrid and xslt to change the xml data; example:
viewtopic.php?p=32941#p32941
(Then overwrite the old file with the new one.)

penpen
by penpen
09 Jan 2020 17:22
Forum: DOS Batch Forum
Topic: Change the system date
Replies: 2
Views: 136

Re: Change the system date

Dealing with dates is highly system dependent, so the following might (or mght not) help you (untested): @echo off setlocal enableExtensions enableDelayedExpansion for %%a in ( "jan=-01-" "feb=-02-" "mar=-03-" "apr=-04-" "mai=-05-" "jun=-06-" "jul=-07-" "aug=-08-" "sep=-09-" "oct=-10-" "nov=-11-" "d...
by penpen
24 Dec 2019 19:38
Forum: DOS Batch Forum
Topic: How do I....
Replies: 3
Views: 356

Re: How do I....

Another option were to use xslt to change the xml data; example:
viewtopic.php?p=32941#p32941

penpen
by penpen
24 Dec 2019 19:34
Forum: DOS Batch Forum
Topic: For /f loop findstr problem The batch script finds nothing !!!
Replies: 2
Views: 342

Re: For /f loop findstr problem The batch script finds nothing !!!

for /f "skip=1 tokens=* usebackq" %%a in (`^""C:\Program Files\7-Zip\7z.exe" h -scrcsha256 "Test.7z" ^| findstr "SHA256 for data"^"`) do echo %%a The batch script finds nothing !!!! I tested that batch code and it works?! Maybe you wanted to add a "/c:" (without doublequotes) like in the sniplet ab...
by penpen
24 Dec 2019 19:07
Forum: DOS Batch Forum
Topic: Wacom tablet pressure input for cmd
Replies: 4
Views: 433

Re: Wacom tablet pressure input for cmd

The Wacom Forum might be able to answer you that for all Wacom tablets:
http://forum.wacom.eu/

penpen
by penpen
13 Dec 2019 05:38
Forum: DOS Batch Forum
Topic: Using the rename command
Replies: 9
Views: 717

Re: Using the rename command

The following code might help you (although i suspect that you didn't describe the whole issue):

Code: Select all

rename "Encoder_TestHarnessLog_19_12_13-083023.xml" "Test1_19_12_13-083023.xml"
penpen
by penpen
10 Dec 2019 13:33
Forum: DOS Batch Forum
Topic: Split string to characters
Replies: 31
Views: 10507

Re: Split string to characters

See dbenham's "Percent Expansion Rules" for more: https://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912 Because variable name1 doesn't exist the part [%name1:] (without brackets) is removed, Variable [" EQU "] (without brackets) al...
by penpen
09 Dec 2019 07:09
Forum: DOS Batch Forum
Topic: If Else bracket error Help
Replies: 2
Views: 454

Re: If Else bracket error Help

I suspect you want to do that: if exist "D:\Test1" ( if exist "D:\Test2" ( echo OK ) else ( echo Error ) ) else ( echo Error ) Although most probably both of your above code does not work as you intended, it should work fine (from technical viewpoint only). Your first sample code should: - do nothin...
by penpen
04 Dec 2019 19:28
Forum: DOS Batch Forum
Topic: Show drive letter of DVD drive
Replies: 2
Views: 462

Re: Show drive letter of DVD drive

I assume the for/f loop you are using already determines your dvd drive encapsulating it in the %%i for-variable. So just use store that value to an environment variable and use that befor your "endlocal" (which restores the variables to a prior state; untested): @echo off setlocal enableExtensions ...
by penpen
21 Nov 2019 07:31
Forum: DOS Batch Forum
Topic: NEWBIE HERE :)
Replies: 3
Views: 700

Re: NEWBIE HERE :)

1. Whenever I see symbols like "ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ" in a batch script sometimes they turn into lines or shapes but then again sometimes they just look like random charecters, depending on the game I open, including if I copy and past them into mine I was wonder...
by penpen
17 Nov 2019 03:58
Forum: DOS Batch Forum
Topic: I need help
Replies: 15
Views: 1079

Re: I need help

David was not clear in his explanation so there are two options in 2 cases Could you give some more context information and also link to the post(s) you are referring to? I want to convert some hex codes to the codes used by MS-DOS Intuitively i would use environment string manipulation for that (b...