Search found 4145 matches

by Squashman
15 Jun 2021 22:36
Forum: DOS Batch Forum
Topic: Batch script to rename text files to match image files names.
Replies: 5
Views: 138

Re: Batch script to rename text files to match image files names.

Type would be slower. You just need to use the command modifiers to get the base file name and then add the txt extension.

copy "Placehold.txt" "%%~na.txt"
by Squashman
15 Jun 2021 22:32
Forum: DOS Batch Forum
Topic: A Batch File to Process Multiple FFmpeg Commands
Replies: 1
Views: 99

Re: A Batch File to Process Multiple FFmpeg Commands

Your code as posted will run only one at a time in a batch file.
by Squashman
24 May 2021 08:42
Forum: DOS Batch Forum
Topic: If not exist command
Replies: 1
Views: 345

Re: If not exist command

You have not shown us enough code to make any definitive solution to your problem.

Not understanding why you are checking it after the robocopy command.
by Squashman
23 May 2021 22:07
Forum: DOS Batch Forum
Topic: Sending command to a single in a text file
Replies: 2
Views: 346

Re: Sending command to a single in a text file

Why not....?

Code: Select all

echo %computername% %date%
by Squashman
17 May 2021 07:41
Forum: DOS Batch Forum
Topic: How to add files larger than 100 kb to the 7z archive?
Replies: 1
Views: 405

Re: How to add files larger than 100 kb to the 7z archive?

The FOR command provides a mechanism to get the size of a file.

Code: Select all

for %%G IN (somefile.txt) do @echo %%~zG
You may have remembered this when you were directed to read the help file when you asked this question
by Squashman
15 May 2021 21:12
Forum: DOS Batch Forum
Topic: Run program with different methods in loops
Replies: 3
Views: 521

Re: Run program with different methods in loops

liargof wrote:
15 May 2021 06:14
Thank you!

If I want to see each method running in separate CMD window, should I remove the "/b" that comes after the "start"?

What I want is that each method will run in loops in its own command window
What is stopping you from testing that code change?
by Squashman
10 May 2021 12:39
Forum: DOS Batch Forum
Topic: Batch Rename of files in a folder
Replies: 1
Views: 458

Re: Batch Rename of files in a folder

You were pretty much given the code in your previous question from 6 years ago.

Code: Select all

FOR /F "tokens=1-6 delims=-" %%A IN ('dir /a-d /b *.dwg') DO rename "%%A-%%B-%%C-%%D-%%E-%%F"  "%%A-%%B-%%C-%%D-1961-%%F"
by Squashman
06 May 2021 07:55
Forum: DOS Batch Forum
Topic: A tool for managing multiple running dos batches
Replies: 8
Views: 792

Re: A tool for managing multiple running dos batches

Hi Squash, Thanks, but I think the users need an interface. But you're right, TASKLIST can be useful in some contexts, when writing batches that need to check if other batches are running. TASKLIST with verbose output will also show you what you want. Then you can use TASKKILL. Not that hard to bui...
by Squashman
06 May 2021 07:55
Forum: DOS Batch Forum
Topic: A tool for managing multiple running dos batches
Replies: 8
Views: 792

Re: A tool for managing multiple running dos batches

what does this TASKKILL command do? H:\>taskkill /? TASKKILL [/S system [/U username [/P [password]]]] { [/FI filter] [/PID processid | /IM imagename] } [/T] [/F] Description: This tool is used to terminate tasks by process id (PID) or image name. Parameter List: /S system Specifies the remote syst...
by Squashman
05 May 2021 20:44
Forum: DOS Batch Forum
Topic: A tool for managing multiple running dos batches
Replies: 8
Views: 792

Re: A tool for managing multiple running dos batches

TASKLIST with verbose output will also show you what you want. Then you can use TASKKILL.
by Squashman
05 May 2021 20:39
Forum: DOS Batch Forum
Topic: How to get MD5 hash only (Batch Script)
Replies: 1
Views: 479

Re: How to get MD5 hash only (Batch Script)

So you failed to search Stack overflow for an answer to your question.
https://stackoverflow.com/questions/674 ... tch-script
And you failed to search our forum here as well.
viewtopic.php?t=7592
by Squashman
26 Apr 2021 10:56
Forum: DOS Batch Forum
Topic: Taskkill %0
Replies: 6
Views: 882

Re: Taskkill %0

If you are scheduling this to run with Windows Task Scheduler it has this functionality built-in to the task creation. You just need edit the appropriate settings in the scheduled task.
by Squashman
25 Apr 2021 21:10
Forum: DOS Batch Forum
Topic: bat file dont run
Replies: 3
Views: 696

Re: bat file dont run

Sperhak wrote:
24 Apr 2021 14:06
Many thanks, work.
Please consider reading the help file for a command before asking questions. The help file literally explains the single and double percent usage on the 8th line.
by Squashman
23 Apr 2021 13:47
Forum: DOS Batch Forum
Topic: output computer, AD User
Replies: 4
Views: 780

Re: output computer, AD User

Is there a question? I don't see anything syntactically wrong with your code.