Search found 1616 matches

by Aacini
20 Nov 2019 00:05
Forum: DOS Batch Forum
Topic: Employee clock in / clock out .bat
Replies: 10
Views: 133

Re: Employee clock in / clock out .bat

Perhaps this answer may help you...

Antonio
by Aacini
30 Oct 2019 06:47
Forum: DOS Batch Forum
Topic: help for command
Replies: 5
Views: 760

Re: help for command

So your question is intended just for people that know Unix, right?

Sorry, but I don't know Unix. Perhaps if I could see what is the result you want, I could write a Batch script for that...

Or you may post this request on a Unix forum.

Antonio
by Aacini
09 Oct 2019 10:30
Forum: DOS Batch Forum
Topic: Remove Microsoft header from cmd, for example when executing code from alternate data stream
Replies: 10
Views: 2887

Re: Remove Microsoft header from cmd when executing code from alternative data stream

Mmmm... A couple remarks about your post... In first place, your problem is not related to Alternate Data Streams. The same effect happen when you redirect any text file into cmd.exe in that way. The simplest way to avoid the initial cmd.exe message is using this format: cmd /d /q < %adsfile%:test1 ...
by Aacini
07 Oct 2019 11:54
Forum: DOS Batch Forum
Topic: [SOLVED] If one of two files exist then do something.
Replies: 18
Views: 3890

Re: If one of two files exist then do something.

You don't need the auxiliary f3 variable; just ask for %bitset% less than 4 to know if File3.exe is missing. You may also do some simplifications: set /A bitset=0, bit=1 for %%f in (File1.exe File2.exe File3.exe) do ( if exist "%userprofile%\Desktop\%%f" set /A "bitset|=bit" set /A "bit<<=1" ) if %b...
by Aacini
19 Sep 2019 02:13
Forum: DOS Batch Forum
Topic: [Resolved] For loop to do something with all variables beginning with a string [also find variables order of appearance]
Replies: 10
Views: 2871

Re: [Resolved] For loop to do something with all variables beginning with a string [also find variables order of appeara

You may achieve the same result in simpler ways. For example: @echo off setlocal enabledelayedexpansion rem Below there is a method to define variables by putting them in a FOR command. rem Optionally you may also define a list of variables this way: rem set values="example-one=value" "example-two=v...
by Aacini
18 Sep 2019 08:56
Forum: DOS Batch Forum
Topic: [Resolved] For loop to do something with all variables beginning with a string [also find variables order of appearance]
Replies: 10
Views: 2871

Re: For loop to do something with all variables beginning/prefixed with a string

No. There is no way to control the order in that SET command lists the defined variables; that is the reason because it is convenient to define different arrays with numerical indices...

I suggest you to review this topic...

Antonio
by Aacini
12 Sep 2019 11:13
Forum: DOS Batch Forum
Topic: ProgramA closes and ProgramB closes automatically
Replies: 3
Views: 1408

Re: ProgramA closes and ProgramB closes automatically

Try: @echo off start "" "C:\Users\Viktor\Documents\FreeFileSync Auftraege\RealTimeSync Auftraege\RealTime_(.minecraft-GoogleDrive)_[Mirror].ffs_real" start "" "C:\Users\Viktor\Documents\FreeFileSync Auftraege\RealTimeSync Auftraege\RealTime_(.minecraft-Backupfolder)_[Mirror].ffs_real" ( start "" "C:...
by Aacini
05 Sep 2019 05:14
Forum: DOS Batch Forum
Topic: rename files in a directory in a batch
Replies: 3
Views: 1185

Re: rename files in a directory in a batch

Your problem description is confusing an incomplete. You should describe the problem using plain English instead of examples or code segments. If a real filename does not match the examples shown, the method may fail. The code segments may lead to wrong assumptions. For example, I don't know Foxpro,...
by Aacini
04 Sep 2019 15:55
Forum: DOS Batch Forum
Topic: Send certutil output directly to a variable instead of file, and then finally copy to clipboard?
Replies: 6
Views: 3160

Re: Send certutil output directly to a variable instead of file, and then finally copy to clipboard?

I prefer the redirection < syntax because it is more efficient. The | pipe requires the execution of two additional copies of cmd.exe

Antonio
by Aacini
04 Sep 2019 15:48
Forum: DOS Batch Forum
Topic: Batch script to remove duplicate rows while ignoring first few characters
Replies: 3
Views: 1194

Re: Batch script to remove duplicate rows while ignoring first few characters

Code: Select all

@echo off
setlocal DisableDelayedExpansion

(for /F "tokens=1* delims=_" %%a in (input.txt) do (
   if not defined key["%%b"] (
      set key["%%b"]=1
      echo %%a_%%b
   )
)) > output.txt
Antonio
by Aacini
01 Sep 2019 11:07
Forum: DOS Batch Forum
Topic: Multi-line menu with options selection via DOSKEY
Replies: 15
Views: 10324

Re: Multi-line menu with options selection via DOSKEY

@Aacini I found a strange thing lately,with this script: @echo off :null PowerShell Exit($host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown').VirtualKeyCode); echo %errorlevel% goto null this can detect arrow keys, but only as %&'( (key 37,38,39,40) So far this is the closest thing I could find for arro...
by Aacini
30 Aug 2019 13:07
Forum: DOS Batch Forum
Topic: Bit Twiddling Hacks in Batch
Replies: 6
Views: 1840

Re: Bit Twiddling Hacks in Batch

Mmmm... These are my thoughts... Binary numbers and binary arithmetic is a tool that allows to perform arithmetic operations in a much efficient way than decimal operations, so is the right tool when speed is important in an application. Binary numeral system also allows to solve a problem in a much...
by Aacini
18 Aug 2019 04:53
Forum: DOS Batch Forum
Topic: Multi-line menu with options selection via DOSKEY
Replies: 15
Views: 10324

Re: Multi-line menu with options selection via DOSKEY

@Szecska, As I said before , you may get the same result in a much simpler way using a choice /N /C 123450 command; I don't see any reason to use the replace.exe method here... IMHO these replace.exe-based examples should be moved to the replace.exe explanation method thread. Those "option selection...
by Aacini
09 Aug 2019 20:37
Forum: DOS Batch Forum
Topic: SORT Order not working correction
Replies: 8
Views: 4043

Re: SORT Order not working correction

Are you using SORT not for sorting, but to get maximum and minimum? And two times ? :shock: Strange thing... Why not keep things simple? Try: @echo off setlocal set /A max=-99999, min=99999 for /F "usebackq tokens=5,6 delims=|" %%a in ("%%~F") do ( if %%a gtr !max! set "max=%%a" if %%a lss !min! set...