0
我寫了一個批處理文件,它將獲得sql server命名實例(mssqlserver \ india)和磁盤可用空間。 對文件內容如下:如何在批處理腳本中跳過系統消息「系統找不到指定的路徑」
mssqlserver\India,D,20
mssqlserver\India,C,30
現在我已經寫一個批處理文件來生成基於文本文件Result.txt
一個HTML報告。但是,我的批處理腳本正在將mssqlserver \ India選爲系統位置,並在文本文件中爲每個條目彈出消息,並在按Enter鍵後移至下一個變量。
我想在沒有任何用戶交互的情況下忽略此消息。下面是我使用的腳本:
@ECHO off
setlocal EnableDelayedExpansion
SETLOCAL
cd C:\Users
goto head >nul
:head
FOR /F "tokens=1-6 delims=," %%G IN (Result.txt) DO (
%%G%%H%%I
set temphost1=%%G
set temphost2=%%H
set temphost3=%%I
call :stripquotes %temphost1% %temphost2% %temphost3% >NUL
)
goto :end
:stripquotes
echo ^<tr bgcolor="#90EE90"^>^<td^>^%temphost1%^</td^>^<td^>^%temphost2%^</td^>^<td^>^%temphost3%^</td^>^</tr^>^ >> C:\Users\Report.html
:END
CLS
ECHO COMPLETED
PAUSE