Search found 4332 matches

by Squashman
22 Nov 2023 20:39
Forum: DOS Batch Forum
Topic: Change to upper case and add a :
Replies: 4
Views: 25733

Re: Change to upper case and add a :

I would like to make sure the input letter is upper case and I would like to add a : the code below doesn't add the colin. setlocal EnableDelayedExpansion set /p Drive=Please enter drive letter. Example C call :Uppercase Drive set "colin = :" set "Drive &= %colin%" Echo %Drive% cmd /k You cannot be...
by Squashman
16 Nov 2023 11:38
Forum: DOS Batch Forum
Topic: [Solved] Need help to convert single line xml file to sequential line
Replies: 7
Views: 31200

Re: Need help to convert single line xml file to sequential line

This should get you started. https://stackoverflow.com/questions/33077104/batch-script-for-formatting-xml-files-search-for-strings-and-comment-them-out Hey thanks, but this doesn't skip the first 2 tags and I don't want it to be format like this <xml> <tag> <othertag> </othertag> </tag> </xml> Wasn...
by Squashman
10 Nov 2023 15:59
Forum: DOS Batch Forum
Topic: Problems working a script
Replies: 6
Views: 30613

Re: Problems working a script

Tai wrote:
06 Nov 2023 01:42
It is not a homework assignment, but an optional task to learn more.
Image
by Squashman
03 Nov 2023 05:18
Forum: DOS Batch Forum
Topic: Foxidrive has left us
Replies: 44
Views: 277696

Re: Foxidrive has left us

7 years. Your contributions and comraderie are missed.
by Squashman
31 Jul 2023 22:25
Forum: DOS Batch Forum
Topic: Info about deletion lies when no items were deleted when dealing with sub-folders
Replies: 2
Views: 5331

Re: Info about deletion lies when no items were deleted when dealing with sub-folders

Set a variable inside the loop. The variable will only be defined if the execution of the FOR command has data to parse. Then echo if the variable is defined. @echo off set "ITEMS-IN-THIS-FOLDER-WILL-BE-DELETED=C:\q\Corel Draw - CDR Auto-Backup Files\" set "file_flag=" for /r "%ITEMS-IN-THIS-FOLDER-...
by Squashman
31 Jul 2023 22:05
Forum: DOS Batch Forum
Topic: Batch file works fine. When converted to exe it doesn't
Replies: 1
Views: 4863

Re: Batch file works fine. When converted to exe it doesn't

Search the forum. This topic has been covered ad nauseam. Those threads will discuss the basics. 1) You are not creating an executable. You are creating a self-extracting file. It first extracts all the data to a temporary folder before executing. 2) The exe extracting the batch file to a temporary ...
by Squashman
31 Jul 2023 22:01
Forum: DOS Batch Forum
Topic: escaping powershell in batch loop
Replies: 1
Views: 5174

Re: escaping powershell in batch loop

Remember you are using a batch file. So any special characters need to be escaped. The closing parentheses thinks you are closing the FOR argument so it thinks the hyphen is a command. You need to escape them. for /f "usebackq tokens=1-3 delims=- " %%a in (` powershell.exe -Command "Get-EventLog -Er...
by Squashman
03 May 2023 19:04
Forum: DOS Batch Forum
Topic: Notepad bug
Replies: 10
Views: 19494

Re: Notepad bug

Momentarily i can't check whether or not notepad offers selecting a specific encoding for other versions of windows. Wow. I never even knew that was an option in Notepad. I have always just opened up a text file by using my mouse. Interesting to know that it is just guessing the wrong encoding. I w...
by Squashman
02 May 2023 15:39
Forum: DOS Batch Forum
Topic: Notepad bug
Replies: 10
Views: 19494

Notepad bug

Hi Everyone. Long time no see. Got a new job working in the Unix world so kind of gave up on the batch file stuff. But........today my old job called me because of an issue with a text file they were viewing in notepad. The file was nothing but a single line. A trailer record in this case as the fil...
by Squashman
23 Feb 2022 18:31
Forum: DOS Batch Forum
Topic: How to remove a path from all lines in file? Filenames should be kept.
Replies: 1
Views: 6056

Re: How to remove a path from all lines in file? Filenames should be kept.

I just went back and looked at a lot of your threads. I see no reason why you shouldn't know how to do this already with all of the code you have been given the past 10 years. Many of your threads show the usage of the `FOR` command modifiers that allows you to split apart the path and file name and...
by Squashman
21 Feb 2022 22:36
Forum: DOS Batch Forum
Topic: Wmic.exe
Replies: 26
Views: 47495

Re: Wmic.exe

This is awesome! Thanks Antonio!
by Squashman
18 Feb 2022 17:06
Forum: DOS Batch Forum
Topic: Wmic.exe
Replies: 26
Views: 47495

Re: Wmic.exe

I don't expect that MS is going to remove WMIC from the CLI tools in the near future. Did you find any information that makes you believe they are about to do so, Squashman? However, PS is an alternative as well as JS. And if I have to calculate with datetime values, I already tend to use them rath...
by Squashman
16 Feb 2022 02:04
Forum: DOS Batch Forum
Topic: Wmic.exe
Replies: 26
Views: 47495

Wmic.exe

What is everyone's plan for when Microsoft pulls the plug on wmic.exe? it has always been our stop gap for getting the date and time in a consistent format. I guess I dont mind calling out to Powershell. Penny for your thoughts.