Scriptsautoupdate.b...
 
Notifications
Clear all

Guests have read-only access to our forums. If you wish to participate you will need to register. Be sure to activate your account from the email sent to you when you register.

[Closed] Scriptsautoupdate.bat bug

1 Posts
1 Users
0 Reactions
1,554 Views
(@venom)
Active Member Registered
Joined: 3 years ago
Posts: 11
Topic starter  

The Dir Cmd is getting Oldest /O:D instead of Newest /O-D

Current:

FOR /F "delims=|" %%I IN ('DIR "SDIO_x64_R*.exe" /B /O:D') DO SET NewestSDIO=%%I

Fixed:

FOR /F "delims=|" %%I IN ('DIR "SDIO_x64_R*.exe" /B /O-D') DO SET NewestSDIO=%%I

All Fixed Code..

::---

@ECHO OFF
::***********************************************************************************
::
:: Keep SDIO.exe updated with the latest drivers and version of SDIO_Rnnn.exe
::
:: Place this batch file in the same directory as the SDIO_*.exe files
::
::***********************************************************************************
::
::SET SDIOPath to location of batch file
SET SDIOPath=%~dp0
PUSHD %SDIOPath%
::Get the newest SDIO_Rnnn.exe file
FOR /F "delims=|" %%I IN ('DIR "SDIO_R*.exe" /B /O-D') DO SET NewestSDIO=%%I
:: Run SDIO update
CALL %NewestSDIO% /autoupdate /autoclose
::Make sure we still have most current executables in case one was just downloaded
FOR /F "delims=|" %%I IN ('DIR "SDIO_R*.exe" /B /O-D') DO SET NewestSDIO=%%I
::Copy current version to SDIO.exe
COPY %NewestSDIO% SDIO.exe /Y
::Same for x64 version
FOR /F "delims=|" %%I IN ('DIR "SDIO_x64_R*.exe" /B /O-D') DO SET NewestSDIO=%%I
::Copy current version to SDIO.exe
COPY %NewestSDIO% SDIO_x64.exe /Y
POPD

::---


   
Glenn's Page