Search found 78 matches

by Meerkat
28 May 2019 10:36
Forum: DOS Batch Forum
Topic: Need help with command line string replacement
Replies: 3
Views: 1793

Re: Need help with command line string replacement

Hello! First of all, I did not try to understand the code :lol: . Sorry . Upon entering for /? in CMD, you get this part: In addition, substitution of FOR variable references has been enhanced. You can now use the following optional syntax: %~I - expands %I removing any surrounding quotes (") %~fI -...
by Meerkat
01 Sep 2018 21:52
Forum: DOS Batch Forum
Topic: %MM% v0.2a - a full-featured WinNT math macro
Replies: 22
Views: 4234

Re: %MM% v0.2a - a full-featured WinNT math macro

Hello! Impressive work! Maybe this was already addressed. When I open the script from CMD, the nth root works. However, when I open the script from clicking, it aborts. Finding 2th root of 10 to 4 decimals starting at 3 guess=(((2-1)*3)+(10/3$(2-1)))/2 guess#1=3.1666 guess#2=3.1622 guess#3=3.1622 Er...
by Meerkat
18 Jul 2018 08:41
Forum: DOS Batch Forum
Topic: Batch Folders
Replies: 1
Views: 731

Re: Batch Folders

See the code (I dont know how to properly start this reply!). The rem commands are comments for understanding the code, so you can remove them. I assume that this batch file is on the "projects" folder. @echo off set /p "id=Enter Project Name: " rem New code... :newcode set /p "lev=Level: " rem Inpu...
by Meerkat
13 Jun 2018 12:26
Forum: DOS Batch Forum
Topic: Deleting folders
Replies: 1
Views: 529

Re: Deleting folders

Apparently, rd/rmdir doesn't support wildcards. Change the problematic line with this instead:

Code: Select all

for /d %%x in ("E:\Dmgr01\wstemp\anonymous*") do rmdir "%%x"
Wherein for /d allows you to loop through directories. Here's a link for more information: https://ss64.com/nt/for_d.html

Meerkat
by Meerkat
08 Apr 2018 12:38
Forum: DOS Batch Forum
Topic: JREPL Usage - working but is this correct?
Replies: 3
Views: 800

Re: JREPL Usage - working but is this correct?

Well you can combine the two JREPL calls into one (the pipe character | means something like "or").

Code: Select all

CD /D "%~dp0"
call jrepl ",,|,$" "" /F "Test.csv" /O -
Meerkat
by Meerkat
30 Jan 2017 04:44
Forum: DOS Batch Forum
Topic: About "Read words separated by space in a batch script"
Replies: 1
Views: 993

About "Read words separated by space in a batch script"

Hello! This is about DBenham's answer in SO here: http://stackoverflow.com/a/19121445 . The code is awesome because it does not treat comma as delimiter. However, even though there is an exclamation in the file, the character is not displayed. Example.txt Rock and Roll! What am I doing in my laip? C...
by Meerkat
26 Jan 2017 04:19
Forum: DOS Batch Forum
Topic: Problem with Data from Parentheses to be Piped to Findstr
Replies: 6
Views: 1988

Re: Problem with Data from Parentheses to be Piped to Findstr

aGerman wrote:

Code: Select all

(
cmd /von /q /c "for /l %%. in (1,1,%l%) do echo !c_%%.!"
)|findstr /BC:"4"


Steffen


Thanks! Just a followup question. Just in case, how can I put it in the IN clause of FOR loop?

Meerkat
by Meerkat
25 Jan 2017 16:07
Forum: DOS Batch Forum
Topic: Problem with Data from Parentheses to be Piped to Findstr
Replies: 6
Views: 1988

Problem with Data from Parentheses to be Piped to Findstr

I have a sample code: @echo off setlocal enabledelayedexpansion set l=100 for /l %%. in (1,1,%l%) do ( set /a "C_%%.=%%.*%%." ) ::First section: This works ( for /l %%. in (1,1,%l%) do echo %%. )|findstr /BC:"4" pause ::Second section: This prints stuff ( for /l %%. in (1,1,%l%) ...
by Meerkat
26 Dec 2016 10:05
Forum: DOS Batch Forum
Topic: HASHSUM.BAT v1.6 - emulate md5sum, shasum, and the like
Replies: 29
Views: 14667

Re: HASHSUM.BAT - emulate md5sum, shasum, and the like

dbenham wrote: What Win version are you using? I've tested on Win 7 and Win 10, and they are not case sensitive.

Windows 7 Starter (SP1).

Meerkat
by Meerkat
26 Dec 2016 06:57
Forum: DOS Batch Forum
Topic: HASHSUM.BAT v1.6 - emulate md5sum, shasum, and the like
Replies: 29
Views: 14667

Re: HASHSUM.BAT - emulate md5sum, shasum, and the like

Thanks for the Batch File! Hmm... Something is weird in my CERTUTIL - the hash algorithm in -hashfile must be capitalized! See this screenshot: http://i.imgur.com/MikGcBr.png Therefore, when using HASHSUM.BAT, I must specify the algorithm capitalized. I do not know if this is only on me, so this nee...
by Meerkat
10 Jun 2016 07:49
Forum: DOS Batch Forum
Topic: Batch Runs Differently in Win 7 and Win 8???
Replies: 3
Views: 1257

Batch Runs Differently in Win 7 and Win 8???

I do not have a Win 8.1 ISO/Virtual Image/DVD (Internet speed here in my country is, well ... ) so I currently have no access to Window 8. Anyways, as I observe in SO, when a batch file, being run in Win 8, contains some external commands (e.g. DISKPART), it seems like CMD runs that external command...
by Meerkat
30 Jan 2016 22:09
Forum: DOS Batch Forum
Topic: Limit of FOR Variables.
Replies: 1
Views: 1296

Limit of FOR Variables.

Hmm... While making a "hex2bin dropper" in Batch, I am curious...

... What is the size limit of a FOR variable? (I mean the limit of storage in %%A, etc.)

Meerkat
by Meerkat
29 Jan 2016 05:18
Forum: DOS Batch Forum
Topic: polyglots/hybrids/chimeras with (popular) windows non native languages.
Replies: 15
Views: 5969

Re: polyglots/hybrids/chimeras with (popular) windows non native languages.

Hmm... Like AutoIt, AutoHotKey uses semi-colon(;) as comments...

Hope this could help.

Meerkat