微剋多資訊

 找回密碼
 註冊

Sign in with google

Google帳號登入

搜索

該用戶從未簽到

升級   0%

主題
發表於 2022-10-16 14:50 | 顯示全部樓層
  1. scriptdir = CreateObject("Scripting.FileSystemObject").GetParentFolderName(WScript.ScriptFullName)
  2. Set shell = CreateObject("WScript.Shell")
  3. shell.CurrentDirectory = scriptdir
  4. shell.Run "測試.bat", 0, True
複製代碼

使用道具

該用戶從未簽到

升級   0%

2F
發表於 2022-10-16 17:02 | 顯示全部樓層
jmsdhn 發表於 2022-10-16 16:27
剛去搜尋shell.CurrentDirectory或CurrentDirectory看能不能知道這是怎麼用的
不過好像沒有官方說明

How Can I Change the Working Folder of a Script?
1 0

使用道具

您需要登入後才可以回帖 登入 | 註冊

本版積分規則

小黑屋|Archiver|微剋多資訊(MicroDuo)

GMT+8, 2024-6-9 06:12

Discuz! X

© 2009-2023 Microduo

快速回覆 返回頂部 返回列表