Search found 4262 matches

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

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

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

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

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

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

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

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

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

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

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

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

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:...
by Squashman
30 Jan 2022 11:42
Forum: DOS Batch Forum
Topic: Find text string in TXT hosted on Server.
Replies: 11
Views: 2869

Re: Find text string in TXT hosted on Server.

So if you have files on another computer on your network how do you get to them?

(Teaching you to fish)
by Squashman
30 Jan 2022 10:22
Forum: DOS Batch Forum
Topic: Find text string in TXT hosted on Server.
Replies: 11
Views: 2869

Re: Find text string in TXT hosted on Server.

So you know the name of the server. You know the severs ip address. You know the name of the file you need to search. You know what the search string is. What is your problem?