1. 假如有設定密碼的話...
echo '密碼' | net use z: \\aaa\bbb /user:帳號
2. 假如沒有設定密碼的話...
echo '' | net use z: \\aaa\bbb /user:帳號
不過在CMD中自動設置IP位置跟映射驱动器會有點點小問題....
net stop dhcp
rundll32 netshell.dll HrRenameConnection
netsh add helper ifmon.dll
netsh interface ip set address "區域連線" static addr=192.168.1.147 mask=255.255.255.0 gateway=192.168.1.252 auto
netsh interface ip set address "區域連線" static addr=192.168.1.147 mask=255.255.255.0 gateway=192.168.1.252 auto
netsh interface ip set dns "區域連線" static 192.168.1.252
netsh interface ip add dns "區域連線" 192.168.1.253
net start dhcp
echo '密碼' | net use z: \\aaa\bbb /user:帳號
net stop dhcp
rundll32 netshell.dll HrRenameConnection
netsh add helper ifmon.dll
netsh interface ip set address "區域連線" static addr=192.168.1.147 mask=255.255.255.0 gateway=192.168.1.252 auto
pecmd.exe wait 1000
netsh interface ip set address "區域連線" static addr=192.168.1.147 mask=255.255.255.0 gateway=192.168.1.252 auto
netsh interface ip set dns "區域連線" static 192.168.1.252
netsh interface ip add dns "區域連線" 192.168.1.253
net start dhcp
pecmd.exe wait 1000
echo '密碼' | net use z: \\aaa\bbb /user:帳號