ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

IDEA: Batch Editor for URL and LNK Properties

<< < (3/22) > >>

skwire:
I can do this one in a day or three if nobody gets to it sooner.   :Thmbsup:

ConstanceJill:
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


--- ---@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

wraith808:
That's some serious batch file work there!  Takes me back a ways... excellent work!  :Thmbsup:

berkland:
AGREE!!  This is an excellent batch file!  Again, thanks to all for their interest and ideas!

More questions:

What changes would have to be made to this batch file to run from the root directory and include all sub-directories?

What changes would have to be made to this batch file to selectively find and replace text in the Start in: and Comment: fields?  (Maybe some kind of user screen input?)

Could this batch file be incorporated into an .exe file to allow a slick User Interface for the user to search, sort, and select .lnk files and then process/edit them?  (I’m thinking this .exe file would probably have to include the code from the shortcut.exe file.)

Finally, what about URL files?  Can they be included in the same software or would that be a separate program?

THANK YOU!!!!

berkland:
Correction:  Could this batch file be incorporated into an .exe file to allow a slick User Interface for the user to search, sort, and select .lnk files and then process/edit them?  (I’m thinking this .exe file would probably have to include the code from the shortcut.exe file.)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version