Home > Blockchain >  Running links to batch files from another batch file and use the shortcut layout properties
Running links to batch files from another batch file and use the shortcut layout properties

Time:02-11

I have a set of 7 batch files I keep running all night at work, monitoring directories and files. I have shortcuts created and used the Layout tab to arrange and resize them so I can still use my desktop. I just created an extremely simple batch file I use to start the other 7. But when I run it all the new windows open on top of each other. I can't figure out how to use the Layouts I have set up for each shortcut so the command shells open in the positions and sizes I need.
"start everything.bat"

@echo off
start cmd /c call "j:\network drive with spaces\shortcuts\batch file1.bat.lnk"
start cmd /c call "j:\network drive with spaces\shortcuts\batch file2.bat.lnk"
start cmd /c call "j:\network drive with spaces\shortcuts\batch file3.bat.lnk"
start cmd /c call "j:\network drive with spaces\shortcuts\batch file4.bat.lnk"
start cmd /c call "j:\network drive with spaces\shortcuts\batch file5.bat.lnk"
start cmd /c call "j:\network drive with spaces\shortcuts\batch file6.bat.lnk"
start cmd /c call "j:\network drive with spaces\shortcuts\batch file7.bat.lnk"

Is it possible to get the new windows how and where I need them, or am I pretty much stuck just running the shortcuts manually? This is running on Windows Server 2012, and like I said it's at work so I don't have access to install anything, or use any 3rd party apps.

CodePudding user response:

For each of the .lnk files, view the properties and goto the layout tab.

enter image description here

In the "window position" section, remove the tick for "let system position window" and then adjust where each window should be located, apply and exit.

Now, in your batch calling all the batch links, change to this:

@echo off
for %%i in ("j:\network drive with spaces\shortcuts\*.lnk") do start "" "%%~fi"

If however there are more .lnk files and you only want to open some, then do:

@echo off
set links="batch file1.bat.lnk" "batch file2.bat.lnk" "batch file3.bat.lnk" "batch file4.bat.lnk" "batch file5.bat.lnk" "batch file6.bat.lnk" "batch file7.bat.lnk"
for %%i in (%links%) do start "" "j:\network drive with spaces\shortcuts\%%~i"
  • Related