System.Text.RegularExpressions.Regex.Split

using System.IO;

StreamReader sr = new StreamReader(System.Environment.CurrentDirectory + "\\note.txt");
List<string> listLines = new List<string>();
listLines.AddRange(System.Text.RegularExpressions.Regex.Split(sr.ReadToEnd(), "\r\n"));
sr.Dispose();

FOR 輸出時被空白截斷

因為FOR指令預設分隔符號是空白和Tab,故需複寫。
@ECHO OFF
FOR /f "delims=" %%a in ('DIR *.txt /b') DO ECHO %%a
PAUSE

dos - batch file for loop with spaces in dir name - Stack Overflow

建立捷徑

static void urlShortcutToDesktop(string linkName, string linkUrl)
{
    using (StreamWriter writer = new StreamWriter(rootPath + linkName + "\\" + linkName + ".url"))
    {
        writer.WriteLine("[InternetShortcut]");
        writer.WriteLine("URL=" + linkUrl);
        writer.Flush();
    }
}

pass parameters include and-sign in batch

參數、變數包含『&』符號,記得使用雙引用包起來
ECHO時,請取代成^& SET "a=abc&123&def"
ECHO %a:&=^&%
PAUSE

Quotes, Escape Chars, Delimiters

win7 開機自動連線

  1. 建立Hinet連線
  2. Hinet的撥號選項只留『連線時顯示進度』或者全部都不打勾
  3. 啟動資料夾建立捷徑,C:\Windows\System32\rasphone.exe -d Hinet
  4. 如發生錯誤711:無法載入「遠端存取服務連線管理員」。請檢查下列服務皆需啟動:
    • Telephony
    • Remote Access Connection Manager
    • Remote Access Auto Connection Manager

當您建立網路連線時發生錯誤 711:Cannot Load Remote Access Service Connection Manager 錯誤訊息