Search found 503 matches

by npocmaka_
27 May 2021 14:18
Forum: DOS Batch Forum
Topic: For /F to process multiple lines
Replies: 2
Views: 272

Re: For /F to process multiple lines

you havent defined the tokens you want to get.

try with

Code: Select all

For /F "tokens=1* delims=:" %%G in (
  'systeminfo'
) do (
  set "%%G=%%H"
)

tokens option will assign the string before the first `:` to the %%G and everything else to the %%H
by npocmaka_
27 May 2021 14:14
Forum: DOS Batch Forum
Topic: package manager
Replies: 2
Views: 307

Re: package manager

Package Manager:packagemgr.jpg (Sorry, couldn't resist. I mean, wow, this is certainly the most minimalistic post I've ever seen on DosTips. Would you mind to at least leave one sentence what you get if you follow the link and why it's worth to check this out? Thanks! Steffen)[ /size] npm for node ...
by npocmaka_
08 Nov 2020 09:13
Forum: DOS Batch Forum
Topic: batch file PID
Replies: 6
Views: 2237

Re: batch file PID

https://github.com/npocmaka/batch.scrip ... CmdPID.bat - you can try with this. It saves the PID to the errorlevel
by npocmaka_
02 Nov 2020 04:11
Forum: DOS Batch Forum
Topic: Nesting statement if ()==() ( ) gives an error
Replies: 2
Views: 1697

Re: Nesting statement if ()==() ( ) gives an error

One of your closing brackets is actually an opening one. Try like this: @ECHO OFF IF (c)==(c) ( echo test IF "(b)"=="(b)" ( echo yes ) ) the closing bracket in the nested if compared strings is taken for a closing bracket of the outer if. May be this example will be more descriptive: IF (c)==(c) ( I...
by npocmaka_
06 Oct 2020 12:41
Forum: DOS Batch Forum
Topic: Output messages I can't invoke.
Replies: 2
Views: 2843

Re: Output messages I can't invoke.

https://github.com/shaswata56/WindowsXP/blob/master/base/cmd/cmdmsg.mc here are the message ids that can be searched in the repository for some insights. Since windows vista these messages are stored in the .mui files in order to achieve some localisation. Looks like the process id can be printed in...
by npocmaka_
05 Jun 2020 12:26
Forum: DOS Batch Forum
Topic: Batch wont display anything on my new PC???
Replies: 5
Views: 2595

Re: Batch wont display anything on my new PC???

try with the console properties->terminal and try to use separate colors.
by npocmaka_
19 May 2020 13:28
Forum: DOS Batch Forum
Topic: pktmon.exe
Replies: 7
Views: 2778

Re: pktmon.exe

Very useful and very dangerous at the same time as a compromised system on a network can now automatically hack the network with the right batch file. :shock: That's a bit misleading. You can snoop on traffic, but you can't inherently do anything with it. It's like Wireshark. But in the article, th...
by npocmaka_
19 May 2020 04:13
Forum: DOS Batch Forum
Topic: pktmon.exe
Replies: 7
Views: 2778

pktmon.exe

There's a new command line tool in windows 10 that I've missed and looks interesting:

https://www.bleepingcomputer.com/news/m ... ow-to-use/
by npocmaka_
29 Apr 2020 07:41
Forum: DOS Batch Forum
Topic: Can SET be filled by a command?
Replies: 7
Views: 3374

Re: Can SET be filled by a command?

the common way is to use for /f:

Code: Select all

for /f "tokens=* delims=" %%# in ('myapp.exe input.pdf') do set "count=%%#"
echo %count%
by npocmaka_
28 Apr 2020 02:28
Forum: DOS Batch Forum
Topic: more tricks with certutil
Replies: 11
Views: 11459

Re: more tricks with certutil

downloading files with certutil is no more possible: certutil.exe -urlcache -split -f "https://download.sysinternals.com/files/PSTools.zip" pstools.zip As certutil has access to sensitive directories it was able to download (and overwrite) files in system directories this way of downloading is now t...
by npocmaka_
18 Apr 2020 10:19
Forum: DOS Batch Forum
Topic: mshta and javascript
Replies: 31
Views: 47002

Re: mshta and javascript

The code you've posted will work. But calling it without 'dedicated' file will not. Try this snipped by dbenham: @echo off setlocal :: Define simple macros to support JavaScript within batch set "beginJS=mshta "javascript:close(new ActiveXObject('Scripting.FileSystemObject').GetStandardStream(1).Wri...