Search found 496 matches

by Compo
20 Sep 2020 10:34
Forum: DOS Batch Forum
Topic: IFEO Tool - Block malicious EXEs from running in your machine
Replies: 2
Views: 107

Re: IFEO Tool - Block malicious EXEs from running in your machine

IMO, the entire thing is a waste of time done this way. It's too much effort to locate and invoke a batch file elevated, press on a number key, type a filename, press enter, press enter again, and then force close the cmd.exe window. You'll only be adding executables which you know you have, so why ...
by Compo
18 Sep 2020 11:05
Forum: DOS Batch Forum
Topic: command retunrs no value even though entry exists
Replies: 14
Views: 457

Re: command retunrs no value even though entry exists

The same variable expansion issue you have with `GamePath` is also evident in your 'Max Payne 2' section, with `D2Test`
by Compo
17 Sep 2020 05:49
Forum: DOS Batch Forum
Topic: Debugging / syntax checksing tools for batch
Replies: 25
Views: 3117

Re: Debugging / syntax checking tools for batch

Indeed. Both of those were pointed out some time ago. And I removed them all a long time ago. It's possible I missed something, but they don't cause the debugger to fail or warn so it's easy to miss them in a long script. I shall check again. EDIT: Nope. All labels that were within ( ) blocks had a...
by Compo
14 Sep 2020 08:44
Forum: DOS Batch Forum
Topic: Debugging / syntax checksing tools for batch
Replies: 25
Views: 3117

Re: Debugging / syntax checksing tools for batch

Based upon the initial code, I've seen, i.e. that posted here , there are several noteworthy things I spotted. Your biggest issue, is that you're using labels inside your parenthesised blocks. Additionally "%SRC%\PostInstall\Firefox Setup 76.0.1" should probably have an extension. IF NOT EXIST "%APP...
by Compo
31 Aug 2020 09:15
Forum: DOS Batch Forum
Topic: Copy Filename - Copy File to other directory - duplicate file - filename+continuous numerating
Replies: 12
Views: 704

Re: Copy Filename - Copy File to other directory - duplicate file - filename+continuous numerating

I've already told you, but you seem unable to either listen or comprehend, the very, very, basic syntax I've used, is fully explained under the help information for the command. And please don't try to absolve yourself of blame for a confusing question, your code specifically states right within it,...
by Compo
30 Aug 2020 15:59
Forum: DOS Batch Forum
Topic: Copy Filename - Copy File to other directory - duplicate file - filename+continuous numerating
Replies: 12
Views: 704

Re: Copy Filename - Copy File to other directory - duplicate file - filename+continuous numerating

Ich bin´s selbst, I have absolutely no intention of tutoring you through my code, however, I will say that it's considerably simpler, shorter, quicker, and easier to follow than what you or OJBakker have posted, and aGerman and others haven't posted any code, (Steffen provided only advice for your p...
by Compo
30 Aug 2020 14:57
Forum: DOS Batch Forum
Topic: Copy Filename - Copy File to other directory - duplicate file - filename+continuous numerating
Replies: 12
Views: 704

Re: Copy Filename - Copy File to other directory - duplicate file - filename+continuous numerating

Ich bin´s selbst, just to clarify to you, and any future readers, what my code above is supposed to do: Make thirty four copies of each file within the %Quelle% directory to the %Ziel% directory, each with the increment appended to its basename. For example: C:\000Quelle\FileName.ext » C:\000Ziel\Fi...
by Compo
30 Aug 2020 11:18
Forum: DOS Batch Forum
Topic: Copy Filename - Copy File to other directory - duplicate file - filename+continuous numerating
Replies: 12
Views: 704

Re: Copy Filename - Copy File to other directory - duplicate file - filename+continuous numerating

Unless I've misunderstood exactly what you're doing, especially as I've no idea what %Z% is being used or incremented for , it seems that there's an simpler method of doing this: @ECHO OFF SETLOCAL ENABLEEXTENSIONS DISABLEDELAYEDEXPANSION REM The task is the following: REM Copy a single file from %Q...
by Compo
10 Aug 2020 08:23
Forum: DOS Batch Forum
Topic: Purge Function - best way?
Replies: 1
Views: 447

Re: Purge Function - best way?

No it isn't! To begin with you shouldn't be using a label within the do portion of a for loop. Would this not do essentially the same thing? CALL :PURGE "C:\Hyperion_Batch\Errors","C:\Hyperion_Batch\Logs","C:\Hyperion_Batch\Archives" PAUSE GOTO :EOF :PURGE SET "AGE=92" FOR %%G IN (%*) DO ( IF /I "%%...
by Compo
10 Aug 2020 08:16
Forum: DOS Batch Forum
Topic: Only accept a numeric number.
Replies: 20
Views: 1582

Re: Only accept a numeric number.

<snip> Echo OS Index number is "OS_Index" & Pause So would the code above work and [ a ] ignore just pressing <Enter>, [ b ] ignore inputting a zero, [ c ] ignore a number greater than 12, [d] ignore ANY letter? Would I use the number held in OS_Index by using "OS_Index" or something else please? I...
by Compo
06 Aug 2020 12:34
Forum: DOS Batch Forum
Topic: Only accept a numeric number.
Replies: 20
Views: 1582

Re: Only accept a numeric number.

First of all, thank you to everyone who has contributed to this question, it is very much appreciated! redacted I had to change that code because it didn't work and just exited the program. redacted Why didn't you try my single line example, (which was split over multiple lines for ease of reading)...
by Compo
01 Aug 2020 13:40
Forum: DOS Batch Forum
Topic: Categorize file extension in .txt output
Replies: 3
Views: 606

Re: Categorize file extension in .txt output

Code: Select all

dir /O:D /T:W  /s *.asi;*.ini;*.cs;*.asi
will pick up some duplicates, because you've already redirected the output from

Code: Select all

dir /O:D /T:W  *.asi;*.ini;*.cs;*.asi
to the same file, Files.txt!
by Compo
31 Jul 2020 12:24
Forum: DOS Batch Forum
Topic: Only accept a numeric number.
Replies: 20
Views: 1582

Re: Only accept a numeric number.

I would probably do it like this, (Obviously the last line would be replaced with your code) : @Echo Off :Menu Set "OS_Index=" Set /P "OS_Index=Input Index Number [1..12]>" If Not Defined OS_Index (GoTo Menu)Else ( Set OS_Index | "%__AppDir__%findstr.exe" ^ "^OS_Index=[123456789]$ ^OS_Index=[1][012]...
by Compo
01 Jul 2020 09:51
Forum: DOS Batch Forum
Topic: Best command to delete a file?
Replies: 3
Views: 981

Re: Best command to delete a file?

It's a matter of opinion really. I believe that you should be polite, i.e ask for an action only if its needed, so my preference is to see if the file exists prior to asking for it to be deleted. However checking if the file exists, is an action in itself, so some would see it as no less efficient t...
by Compo
24 May 2020 14:42
Forum: DOS Batch Forum
Topic: Just the total size of a folder & subfolders
Replies: 3
Views: 1165

Re: Just the total size of a folder & subfolders

The following alternative, will work with your output: @SetLocal EnableExtensions @For /F Tokens^=3 %%G In ('Dir /S/A-D/-C 2^>NUL')Do @Set /A $=#,#=%%G 2>NUL @Echo %$% bytes @Pause I'm not sure if all system languages output the filesize as the third token, so if this is going to be used for any oth...