Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

SIW Wait till exe before rename
#1

I'm trying to update my command prompt based script, but am also open to changing this to power shell.

I run an SIW report with siw.EXE /log:html=c:\AdQue\Bin\SIW1.html /silent /details
I can't figure out how to make my batch file wait for the SIW report to finish so I can rename the report.
We were doing this with a ping to null however with the new version of SIW the report seems to take a bit longer than the 120 seconds.
It would be best if I had a way to have my batch file check for the EXE before continuing with the rename.
Currently I'm getting a file can not be renamed because it's in use error.

set dtt=%dt%_%TIME%
ping -n 120 127.0.0.1 >nul
REN SIW1.html "SIW_%computername%_%dtt%.html"

Thanks,
Joe
Reply
#2

(04-11-2025 02:57 PM)[email protected] Wrote:  I'm trying to update my command prompt based script, but am also open to changing this to power shell.

I run an SIW report with siw.EXE /log:html=c:\AdQue\Bin\SIW1.html /silent /details
I can't figure out how to make my batch file wait for the SIW report to finish so I can rename the report.
We were doing this with a ping to null however with the new version of SIW the report seems to take a bit longer than the 120 seconds.
It would be best if I had a way to have my batch file check for the EXE before continuing with the rename.
Currently I'm getting a file can not be renamed because it's in use error.

set dtt=%dt%_%TIME%
ping -n 120 127.0.0.1 >nul
REN SIW1.html "SIW_%computername%_%dtt%.html"

Thanks,
Joe

You can run your batch from the administrator console or pass the desired filename as an argument:
siw.EXE /log:html="c:\AdQue\Bin\SIW_%COMPUTERNAME%.html" /silent /details

btw, on my computer, your "set dtt=" example generates an invalid file name:
C:\>set dtt=%dt%_%TIME%
C:\>echo %dtt%
%dt%_18:29:42.24
Reply




Users browsing this thread: 1 Guest(s)