101
Post New Requests Here / Re: IDEA: Batch Editor for URL and LNK Properties
« Last post by ConstanceJill on October 25, 2018, 07:00 AM »Alright, the following batch file should scan for all .lnk files in the folder where it's called from, and change them to run maximized, if they're currently set to run in a normal window (NOT if they're set to run minimized, however).
It requires shortcut.exe, to be downloaded from http://www.optimumx.com/downloads.html
It requires shortcut.exe, to be downloaded from http://www.optimumx.com/downloads.html
@ECHO OFF
where shortcut.exe >NUL
IF ERRORLEVEL 1 GOTO error
for /f "delims=" %%# in ('dir /s /b *.lnk') do (
ECHO * Querying shortcut file : "%%#"
shortcut.exe /A:Q /F:"%%#" | findstr /C:"RunStyle=1" >NUL
IF NOT ERRORLEVEL 1 (
ECHO - This shortcut is set to run in a normal window.
ECHO Modifying it to run in maximized window mode.
shortcut /A:E /F:"%%#" /R:3
) ELSE (
ECHO - This shortcut is NOT set to run in a normal window, not touching it.
)
)
ECHO ---
GOTO end
:error
ECHO -----------------------------------------------------------------------------
ECHO ERROR :
ECHO.
ECHO It looks like shortcut.exe was not found.
ECHO You need to download it from http://www.optimumx.com/downloads.html#Shortcut ,
ECHO and place shortcut.exe either in the folder from where you'll call this batch,
ECHO or in a folder that's referenced in your PATH environment variable.
ECHO.
GOTO end
:end
ECHO Done, press any key to close this window.
PAUSE>NUL
where shortcut.exe >NUL
IF ERRORLEVEL 1 GOTO error
for /f "delims=" %%# in ('dir /s /b *.lnk') do (
ECHO * Querying shortcut file : "%%#"
shortcut.exe /A:Q /F:"%%#" | findstr /C:"RunStyle=1" >NUL
IF NOT ERRORLEVEL 1 (
ECHO - This shortcut is set to run in a normal window.
ECHO Modifying it to run in maximized window mode.
shortcut /A:E /F:"%%#" /R:3
) ELSE (
ECHO - This shortcut is NOT set to run in a normal window, not touching it.
)
)
ECHO ---
GOTO end
:error
ECHO -----------------------------------------------------------------------------
ECHO ERROR :
ECHO.
ECHO It looks like shortcut.exe was not found.
ECHO You need to download it from http://www.optimumx.com/downloads.html#Shortcut ,
ECHO and place shortcut.exe either in the folder from where you'll call this batch,
ECHO or in a folder that's referenced in your PATH environment variable.
ECHO.
GOTO end
:end
ECHO Done, press any key to close this window.
PAUSE>NUL

Recent Posts


