Search found 1018 matches

by ShadowThief
24 Apr 2021 13:33
Forum: DOS Batch Forum
Topic: bat file dont run
Replies: 3
Views: 243

Re: bat file dont run

In a batch script, your for loop variable needs to use two %s instead of one.

Code: Select all

for %%i in (*mkv) do md "%%~ni"
for %%i in (*mkv) do move "%%i" "%%~ni"
by ShadowThief
19 Apr 2021 18:58
Forum: DOS Batch Forum
Topic: Windows (and Office?) product key finder
Replies: 13
Views: 977

Re: Windows (and Office?) product key finder

My script runs correctly in Windows 10 (and by correctly, I mean it matches the output of the vbs script in the first post). Frankly, that's the only thing I care about because I refuse to support older versions of Windows. Also, to be blunt, literally nobody needs this script. Your product ID is ei...
by ShadowThief
19 Apr 2021 16:06
Forum: DOS Batch Forum
Topic: Windows (and Office?) product key finder
Replies: 13
Views: 977

Re: Windows (and Office?) product key finder

I only tested 32-bit Windows XP, because why are you running Windows XP in 2021?
by ShadowThief
16 Apr 2021 20:57
Forum: DOS Batch Forum
Topic: Windows (and Office?) product key finder
Replies: 13
Views: 977

Re: Windows (and Office?) product key finder

There were a couple of tricky things here: vbscript substrings are 1-indexed while batch substrings are 0-indexed, and WshShell.RegRead interprets a hex byte array as an array of integers, while reg query takes the value as a string. Other than that, not too bad. @echo off setlocal enabledelayedexpa...
by ShadowThief
12 Apr 2021 01:52
Forum: DOS Batch Forum
Topic: Clobbered cmd.exe!
Replies: 7
Views: 790

Re: Clobbered cmd.exe!

If you haven't installed anything weird recently, it may be worth checking your hard drive's health. Download a disk health program like CrystalDiskInfo (https://crystalmark.info/en/software/crystaldiskinfo/) and make sure everything looks normal (or in this case, that all the dots are blue).
by ShadowThief
09 Apr 2021 13:59
Forum: DOS Batch Forum
Topic: Is there a way to obfuscate parts of a batch file?
Replies: 3
Views: 596

Re: Is there a way to obfuscate parts of a batch file?

Dbenham used ROT13 to obfuscate a significant chunk of his port of Colossal Cave Adventure: viewtopic.php?f=3&t=4876
by ShadowThief
30 Mar 2021 17:00
Forum: DOS Batch Forum
Topic: Batch treat special characters as input errors
Replies: 8
Views: 1275

Re: Batch treat special characters as input errors

I would be remiss if I didn't mention that you can also use xcopy to get user input @echo off setlocal EnableDelayedExpansion ::::: :: Advanced user input in batch [using xcopy] :: https://gist.github.com/Grub4K/2d3f5875c488164b44454cbf37deae80 ::::: :: Returns by echoing result. :: Fetching using f...
by ShadowThief
30 Mar 2021 06:29
Forum: DOS Batch Forum
Topic: How to create a Batch program deleting files having the same extension
Replies: 2
Views: 822

Re: How to create a Batch program deleting files having the same extension

It's probably a permissions issue since you're telling it to start in the root of C:\. Try running the script as administrator.
by ShadowThief
19 Mar 2021 11:54
Forum: DOS Batch Forum
Topic: Command query on excel file
Replies: 5
Views: 1508

Re: Command query on excel file

ShadowThief, It would be safer to perform your search against the content of the target field, not over the entire data record. What happens if, the fish is a catfish, or dogfish? the dog is named Catlin? or the color of the cat is dogs liver? I put in as much effort as ibirp put into their question
by ShadowThief
17 Mar 2021 20:15
Forum: DOS Batch Forum
Topic: Command query on excel file
Replies: 5
Views: 1508

Re: Command query on excel file

@echo off if "%~1"=="" exit /b set "source_file=data.csv" for /f "tokens=1,2 delims= " %%A in ('findstr /C:"%~1" %source_file%') do echo %%A %%B This assumes that Your source file is called data.csv Your data is separated by spaces (despite the C in CSV standing for "comma") You're fine with hardco...
by ShadowThief
16 Mar 2021 06:58
Forum: DOS Batch Forum
Topic: netsh profile name issue
Replies: 8
Views: 1721

Re: netsh profile name issue

The standard escape character in batch is ^
by ShadowThief
04 Mar 2021 15:21
Forum: DOS Batch Forum
Topic: change a file's name inside a directory problem
Replies: 3
Views: 1373

Re: change a file's name inside a directory problem

The REN cannot have a drive or path in the destination. cd to C:\Users\Public\Documents and then just ren databaseTMP.scu database.scu instead.
by ShadowThief
02 Mar 2021 18:21
Forum: DOS Batch Forum
Topic: simple bat file needed
Replies: 2
Views: 1317

Re: simple bat file needed

Is there anything at all inside rnd.txt other than the number? (Spaces, newlines, letters, punctuation?)
by ShadowThief
20 Feb 2021 13:23
Forum: DOS Batch Forum
Topic: Interpret json with batch
Replies: 4
Views: 1428

Re: Interpret json with batch

There's nothing natively because batch predates JSON, but you could use jq or PowerShell.
by ShadowThief
19 Feb 2021 14:07
Forum: DOS Batch Forum
Topic: Problem loading variable from file
Replies: 6
Views: 1649

Re: Problem loading variable from file

Run the script from the command prompt instead of double-clicking it so that the window stays open so that you can see the error that you get.