Search found 4309 matches

by Squashman
03 May 2023 19:04
Forum: DOS Batch Forum
Topic: Notepad bug
Replies: 10
Views: 8635

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

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

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

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

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

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.
by Squashman
15 Feb 2022 00:02
Forum: DOS Batch Forum
Topic: Condense Day-Date-Time Code for Reports.
Replies: 12
Views: 10051

Re: Condense Day-Date-Time Code for Reports.

PAB wrote:
14 Feb 2022 21:03
It also works for the SECOND Script, I just needed to use !Created! instead of %Created%.
You would not need to use delayed expansion for the variable and all the other variables if you just got rid of the UNNECESARY parentheses.
by Squashman
14 Feb 2022 11:36
Forum: DOS Batch Forum
Topic: Batch file to merge two column strings from two files into one file
Replies: 4
Views: 5281

Re: Batch file to merge two column strings from two files into one file

Code: Select all

@echo off
setlocal enabledelayedexpansion
< file2.txt ( FOR /F "delims=" %%G IN (file1.txt) DO (
set /p file2=
echo %%G !file2!
)
)>combined.txt
by Squashman
10 Feb 2022 23:03
Forum: DOS Batch Forum
Topic: Check which of many network domains the current machine is in then run a script
Replies: 8
Views: 7000

Re: Check which of many network domains the current machine is in then run a script

Batch files execute each line in the script from top to bottom. Regardless of the goto, once the for command is done executing it is going to execute the next command in the script.
by Squashman
08 Feb 2022 22:22
Forum: DOS Batch Forum
Topic: Find data in an external database with Batch
Replies: 3
Views: 4312

Re: Find data in an external database with Batch

Three quarters of your problem is not even batch file related. The majority of your knowledge deficit is making the DB queries to verify the data. This forum is not a DB forum. If you need help with the DB queries you will need to ask on another site.
by Squashman
07 Feb 2022 21:48
Forum: DOS Batch Forum
Topic: Batch file to delete specific files on multiple folders
Replies: 2
Views: 4093

Re: Batch file to delete specific files on multiple folders

Like your question over on StackOverFlow , I find your technical requirements vague and incomplete. You need to be very specific and provide accurate details of everything.
by Squashman
06 Feb 2022 10:01
Forum: DOS Batch Forum
Topic: How to spool batch script logic to create another batch script but not expanded?
Replies: 5
Views: 5391

Re: How to spool batch script logic to create another batch script but not expanded?

And here is where we discussed with you about escaping the parentheses. https://www.dostips.com/forum/viewtopic.php?t=8282 I bet if I do another search I will find another thread of yours where we explained escaping the percent symbols. Regardless this site has discussed escaping the percent symbol ...
by Squashman
30 Jan 2022 18:43
Forum: DOS Batch Forum
Topic: goto-jump destroys for-vars/loop
Replies: 1
Views: 3081

Re: goto-jump destroys for-vars/loop

Batch file process from the top down. Once you break out of the FoR construct it finds the label from the top down and starts processing line by line again. If you need to break out of something without breaking the loop then use the CALL command to spawn out to a separate function.
by Squashman
30 Jan 2022 12:41
Forum: DOS Batch Forum
Topic: search for previous item
Replies: 19
Views: 13168

Re: search for previous item

May I enter the timing test contest? 8) find the file at row 99045 C:\BatchFiles\DOSTIPS\10362>TIMETHIS.EXE Antonio.bat E:\19004.zip TimeThis : Command Line : Antonio.bat TimeThis : Start Time : Sun Jan 30 12:39:45 2022 TimeThis : End Time : Sun Jan 30 12:40:14 2022 TimeThis : Elapsed Time : 00:00:...