If one of two files exist then do something.

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
aGerman
Expert
Posts: 3706
Joined: 22 Jan 2010 18:01
Location: Germany

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

#16 Post by aGerman » 07 Oct 2019 13:43

That's weird. Right now I tried the code. Works nicely for me.

Steffen

PAB
Posts: 32
Joined: 12 Aug 2019 13:57

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

#17 Post by PAB » 07 Oct 2019 14:07

Sorry, it was my fault!

I added the userprofile%\Desktop\ to the beginning of "File1.exe" "File2.exe" "File3.exe"

Code: Select all

for %%f in ("File1.exe" "File2.exe" "File3.exe") do (
   if exist "%userprofile%\Desktop\%%~f" set /A "bitset|=bit"
   set /A "bit<<=1"
)
Took them out and it works perfectly!

Post Reply