question

MM-8139 avatar image
0 Votes"
MM-8139 asked Viorel-1 edited

Update the output in script

Question?
--output "C:\outbound\Test.pgp" (generate output file name with Test%CurrentDATETIME%
--status-file C:\logs\status1.log (Generate new log file with current date and time)

-------------------------------------------------------------------------------------------------- Here is the script

@Echo Off
if exist "C:\Inbound*.*" ( Goto :Encrypt) Else ( Goto :End)

:Encrypt
CD "C:\PGP Command Line"
pgp --encrypt "C:\Inbound*." --recipient "@#$%^&(" --output "C:\outbound\Test.pgp" --status-file C:\logs\status1.log
goto :Delete

:Delete
Del /Q "C:\Inbound*.*"

:End

vs-general
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Viorel-1 avatar image
0 Votes"
Viorel-1 answered Viorel-1 edited

Try something like this:

 @echo off
 for /f "skip=1" %%t in ('wmic os get localdatetime') do set T=%%t & goto next
 :next
 set T=%T:~0,14%
    
 . . .
    
 pgp ... --output "C:\outbound\Test%T%.pgp" --status-file "C:\logs\status%T%.log"
    
 . . .

If required, you can insert some separators.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.