0

Okay so, lets say I have this thing:

@echo off 
start ChromePass.exe /stext ChromePass.txt
start PasswordFox.exe /stext PasswordFox.txt
start OperaPassView.exe /stext OperaPassView.txt
start VNCPassView.exe /stext VNCPassView.txt

What I want is, if the file I want to save already exists (lets say there's already a ChromePass.txt) rename the file I am saving.

From ChromePass.txt to ChromePass1.txt, Chromepass2.txt, etc, until there's no file that has the name of the file I'm trying to save.

Thank you

Eazzy_xD
  • 1
  • 2

1 Answers1

0

What about appending a date/time stamp to the file name?
The date/time is a more valuable information than an incremented number.

@echo off 
for /f %%a in ('powershell -NoP -C "get-date -f yyyyMMdd_HHmmss"') Do Set DT=%%a
Echo %DT%

start ChromePass.exe    /stext ChromePass_%DT%.txt
start PasswordFox.exe   /stext PasswordFox_%DT%.txt
start OperaPassView.exe /stext OperaPassView_%DT%.txt
start VNCPassView.exe   /stext VNCPassView_%DT%.txt