Search found 4315 matches

by Squashman
26 Jan 2022 16:34
Forum: DOS Batch Forum
Topic: The fastest way to detect internal IP address
Replies: 8
Views: 7345

Re: The fastest way to detect internal IP address

I use the following command to detect internal IP address (the 4th field): netstat -rn | findstr "\<0.0.0.0\>" In my opinion it's too slow. I think it's because of netstat as the slowest command itself. Slow computer then. On my 8th Gen I7 I blinked and this was done. TimeThis : Command Line : nets...
by Squashman
26 Jan 2022 08:25
Forum: DOS Batch Forum
Topic: Insert Text in Second Last Line of .xml
Replies: 6
Views: 4355

Re: Insert Text in Second Last Line of .xml

If </menu> is the last line of the xml file it should be pretty straight forward. You have to make a new file so just redirect all the lines currently in the file to a new file except for </menu> with the find or findstr commands. Or when you are reading the file with the FOR /F command, check to se...
by Squashman
26 Jan 2022 08:19
Forum: DOS Batch Forum
Topic: type file dont change??
Replies: 5
Views: 3761

Re: type file dont change??

Were you doing this from the command line or a batch file?
by Squashman
19 Jan 2022 12:19
Forum: DOS Batch Forum
Topic: VFile creator
Replies: 15
Views: 14560

Re: VFile creator

I don't see any SUB (hex 1A) or Carriage Returns (hex 0D) in your file.
by Squashman
18 Jan 2022 17:40
Forum: DOS Batch Forum
Topic: VFile creator
Replies: 15
Views: 14560

Re: VFile creator

Could you zip up the text file and upload it here. Or run this code so we can see the hex of those two lines. This does a binary compare of the input file with a dummy file. Input file should be named test.txt @echo off for /f %%a in ('"prompt $H&for %%b in (1) do rem"') do set /p "BS=%%a"<nul >dumm...
by Squashman
18 Jan 2022 08:13
Forum: DOS Batch Forum
Topic: The fastest way to detect internal IP address
Replies: 8
Views: 7345

Re: The fastest way to detect internal IP address

siberia-man wrote:
17 Jan 2022 12:04
My question

Is it 100% reliable way for detecting internal IP address?
If your end goal is to find all devices on your network the answer is no.
by Squashman
18 Jan 2022 08:05
Forum: DOS Batch Forum
Topic: VFile creator
Replies: 15
Views: 14560

Re: VFile creator

The input and output look pretty straightforward. What is stopping your from reading the input with a FOR /F command and echoing the output as needed. The square box is an end of file character also known as a SUB. HEX 1A. We have had several discussion on the forum about how to output that character.
by Squashman
16 Jan 2022 22:26
Forum: DOS Batch Forum
Topic: I have some suggestions for dostips!
Replies: 7
Views: 4848

Re: I have some suggestions for dostips!

This is why i had mentioned it! Powershell is very new to me, but it does do a lot of cool stuff. my current favorite application of ps being: ::list port ranges wmic port get startingaddress, endingaddress :: this will block outgoing ports 30000 - 65535. i need this for an anti-trojen script I'm c...
by Squashman
14 Jan 2022 11:42
Forum: DOS Batch Forum
Topic: Batch File - For Loop Problems
Replies: 6
Views: 8644

Re: Batch File - For Loop Problems

Jedininja wrote:
14 Jan 2022 06:53
some things i noticed, you were trying to add ecm- to %%a before it was defined and also Defining %%a and applying %%a must happen on the same line.
This statement is just wrong.
by Squashman
12 Jan 2022 21:37
Forum: DOS Batch Forum
Topic: Use Checklist to Run Selected Commands.
Replies: 7
Views: 4670

Re: Use Checklist to Run Selected Commands.

If you want to do something really fancy look at the 5th screenshot in this post
viewtopic.php?t=6581#p42362
by Squashman
02 Jan 2022 18:38
Forum: DOS Batch Forum
Topic: How to arrange and array/list?
Replies: 3
Views: 3017

Re: How to arrange and array/list?

Dbenham created JSORT.bat which can sort by a defined column and delimiter.

I guess you don't remember this solution given to you a few years ago.
by Squashman
28 Dec 2021 13:17
Forum: DOS Batch Forum
Topic: reading a TEXT file and i need to bring a structure into it
Replies: 6
Views: 3811

Re: reading a TEXT file and i need to bring a structure into it

The code given to you by aGerman certainly looks like it solves your problem. I am not sure why you have not attempted to use his code. All you did was update your code with what you thought might be a new solution.
by Squashman
26 Dec 2021 19:08
Forum: DOS Batch Forum
Topic: Date/Time Comparison
Replies: 5
Views: 3306

Re: Date/Time Comparison

AR Coding wrote:
26 Dec 2021 16:47
Thanks, Squashman.
:roll:
by Squashman
24 Dec 2021 11:16
Forum: DOS Batch Forum
Topic: getting current, parent directory name with a special & letter
Replies: 13
Views: 7145

Re: getting current, parent directory name with a special & letter

with "ZZ2=%ZZ2:~0,-1%" or not with ZZ2=%ZZ2:~0,-1% if you run this batch c:\abc\xx&yy\ it can display this "%~dp0" but this doesnt run it and causes an error at xx You only addressed one of the three points of my previous comment. As I said in my first comment, you either have to echo the variable ...
by Squashman
24 Dec 2021 10:56
Forum: DOS Batch Forum
Topic: Obfuscate code.
Replies: 19
Views: 9867

Re: Obfuscate code.

MauricioDeAbreu wrote:
24 Dec 2021 09:02
For / f "tokens = *" %% f in ('wmic diskdrive get size / value ^ | find "="') do set "%% f"
The for variable references should not have a space. Nor should the tokens option.