2012/8/31

[Script] BAT 批次檔連線網路磁碟機

[Script] BAT 批次檔連線網路磁碟機
Author: Willie
Date:2012/08031

此範例包含了寫入log檔
Step:
1. 刪除網路磁碟機,代號 S
2. 設定Log 路徑c:\WintekRunScript\RemoteDisk_log.log
3. 處理要印到Log檔的內容
4. 連線網路磁碟機,代號 S


@ECHO OFF
REM 設定電腦閒置網路磁碟機不中斷

NET CONFIG SERVER /AUTODISCONNECT:-1
net use s: /delete
set log_file="c:\WintekRunScript\RemoteDisk_log.log"

echo Remote Disk Connect Begin > %log_file%
echo Current date is: >> %log_file%
date /t < NUL >> %log_file%
echo Current time is: >> %log_file%
time /t < NUL >> %log_file%

net use s: \\edi\transfer /user:scan
echo Remote Disk Connect End >> %log_file%

沒有留言: