Search found 1014 matches

by ShadowThief
12 Apr 2021 01:52
Forum: DOS Batch Forum
Topic: Clobbered cmd.exe!
Replies: 5
Views: 115

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: 101

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:  -
Replies: 8
Views: 474

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: 280

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: 784

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: 784

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: 953

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: 801

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: 765

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: 906

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: 1063

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.
by ShadowThief
19 Feb 2021 02:04
Forum: DOS Batch Forum
Topic: Apostrophe at beginning of file name
Replies: 6
Views: 1087

Re: Apostrophe at beginning of file name

jeb wrote:
19 Feb 2021 01:46
But then after reading the file, it tries to read the "next" filename and fails, but only if the length of the filename is exactly 11 (like Dave said), I can't even imagine why that happens.
Some weird 8.3 filename processing, maybe?
by ShadowThief
10 Feb 2021 12:04
Forum: DOS Batch Forum
Topic: set /p Select=Enter y: Not working
Replies: 6
Views: 1068

Re: set /p Select=Enter y: Not working

I was going to tell you that that line would redirect the output of echo to USBMakeBootable.scr and ignore the list disk bit (because normally you'd use >USBMakeBootable.scr echo list disk), but that totally works. Make sure you're in the right directory.
by ShadowThief
09 Feb 2021 20:51
Forum: DOS Batch Forum
Topic: set /p Select=Enter y: Not working
Replies: 6
Views: 1068

Re: set /p Select=Enter y: Not working

The improper indentation threw me off for a second, but I see now that the %select% variable isn't returning a value because you're both setting and using it inside of the same set of parentheses. If you want to do that, you need to add the line setlocal enabledelayedexpansion to the top of the scri...
by ShadowThief
06 Feb 2021 10:48
Forum: DOS Batch Forum
Topic: Set a multiline variable
Replies: 13
Views: 1724

Re: Set a multiline variable (echo now working)

You could have stayed in the original thread. You have to set variables BEFORE you use them, so move the set check_code line above the set header line. Also, that first >> [F_RESULT]__%COMPUTERNAME%.xml 2>nul being inside of the set header line means that your last line is saying echo >nul & echo.[+...