我有一組 7 個批處理檔案,我在作業中整夜運行,監視目錄和檔案。我創建了快捷方式,并使用“布局”選項卡來排列和調整它們的大小,這樣我仍然可以使用我的桌面。我剛剛創建了一個非常簡單的批處理檔案,我用它來啟動其他 7 個。但是當我運行它時,所有新視窗都在彼此之上打開。我不知道如何使用我為每個快捷方式設定的布局,以便命令外殼以我需要的位置和大小打開。
“開始一切.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"
是否有可能以我需要的方式和位置獲取新視窗,還是我幾乎只能手動運行快捷方式?這是在 Windows Server 2012 上運行的,就像我說它在作業,所以我無權安裝任何東西,或使用任何 3rd 方應用程式。
uj5u.com熱心網友回復:
對于每個.lnk檔案,查看properties并轉到layout選項卡。

在“視窗位置”部分,去掉“讓系統定位視窗”的勾,然后調整每個視窗的位置,應用并退出。
現在,在您的批處理中呼叫所有批處理鏈接,更改為:
@echo off
for %%i in ("j:\network drive with spaces\shortcuts\*.lnk") do start "" "%%~fi"
但是,如果有更多.lnk檔案并且您只想打開一些檔案,請執行以下操作:
@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"
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/428978.html
