0
我寫了下面的JavaScript放在我的啓動文件夾中解決映射驅動器的一些問題。不幸的是,它具有以H:\作爲當前目錄啓動命令提示符的副作用。我怎樣才能解決這個問題?WSH映射驅動器葉默認路徑集
var objNetwork = WScript.CreateObject("WScript.Network");
/* Remove Network Drives */
try {
objNetwork.RemoveNetworkDrive("H:", true, true);
} catch (e) {}
try {
objNetwork.RemoveNetworkDrive("Y:", true, true);
} catch (e) {}
try {
objNetwork.RemoveNetworkDrive("Z:", true, true);
} catch (e) {}
/* Recreate Network Drives */
objNetwork.MapNetworkDrive ("H:", "\\\\server1\\home", false);
objNetwork.MapNetworkDrive ("Y:", "\\\\server2\\source", false, "user", "pass");
objNetwork.MapNetworkDrive ("Z:", "\\\\server3\\source", false, "user", "pass");
您能否闡述* *如何啓動命令提示符?如果是通過快捷方式,則快捷方式屬性值得進行一些檢查。什麼是「開始於:」的價值? – Tomalak 2008-11-18 11:03:46
所以,%HOMEDRIVE%本來是我的下一個問題,但是既然你發現了你自己...... – Tomalak 2008-11-18 11:39:05