跳到主要內容

發表文章

目前顯示的是有「Windows」標籤的文章

無法執行PowerShell腳本

前言 如果在執行PowerShell的時候遇到以下的錯誤訊息的話  ps1 is not digitally signed. You cannot run this script on the current system. 不妨試試以下的指令, 告訴系統暫時先放過這個腳本 powershell.exe -executionpolicy bypass -file .\Script.ps1

如何移植實體機上的Windows 10到 Hyper-V VM - Move Windows 10 From PC to Hyper-V VM

前言 自Windows 7之後多了一個有趣備份的功能, 可以將目前的環境壓成一個VHD檔保存, 將來可以用它來作還原 除此之外這份VHD檔還可以被Hyper-V 的虛擬機器掛載起來使用(達到移植的目的) 以下就示範如何使用這個技術來將實體機上的環境遷移到虛擬機器上跑... Step 1. 首先把目前環境壓成VHD wbAdmin start backup -backupTarget:F: -include:C: -allCritical -quiet 結束之後目的地會多一個資料夾WindowsImageBackup -----------------------------------開始移植--------------------------------------- Step 2. Create a Virtual Machine 使用PowerShell來建立VM New-VM -Name Win10VM -MemoryStartupBytes 8GB -BootDevice VHD -Path .\VMData -Generation 2 Step 3. Attach OS Image 這個步驟中我們需要掛載Windows作業系統的安裝光碟, 待會需要在安裝環境下建立開機檔案 用以下的指令來掛載 Add-VMDvdDrive -VMName Win10VM -Path "D:\OSCD_W10 RS2 Professional_64_EN [for DriverCD].iso" Step 4. Attach our backed VHD 在.\WindowsImageBackup\<PC名稱>\Backup 的目錄底下可以找到Step 1.備份出來的VHD檔(.vhdx) 把VHD掛到VM上 Add-VMHardDiskDrive -VMName Win10VM -ControllerType SCSI -ControllerNumber 0 -ControllerLocation 1 -Path "D:\backup\WindowsImageBackup\ANDY-PC...

[WIX]如何移除安裝成功的視窗

Windows Installer XML Toolset 簡稱WIX, 可以用它很輕易的設計一個Windows 程式的安裝檔 一般而言使用WIX套件做出來的安裝檔,  在安裝完畢後會有一個安裝成功的視窗, 若不希望出現這個視窗, 可以修改ExitDialog.wax裡面的屬性如下 < InstallUISequence >               < Show Dialog = " ExitDialog " OnExit = " success " Overridable = " yes " > 0 </ Show > </ InstallUISequence > < AdminUISequence >               < Show Dialog = " ExitDialog " OnExit = " success " Overridable = " yes " > 0 </ Show > </ AdminUISequence >

Windows Container VS Linux Container

前言 若有在Windows上安裝docker 的經驗的話, 相信一定有看到過以下的畫面, 問你要不要使用Windows 的container Use Windows containers instead of Linux containers (this can be changes after installation) 這是 Windows上才有的功能, 由於微軟非常積極的想推廣他們家的產品, 所以開發了Windows版本的container 目前在docker hub上能拉下來的image還是以Linux為核心的container占大多數, 若單純只是想跑Python 或是 Node js, 基本上不用特別去使用Windows container 除非是想跑.NET的程式那就令當別論了, Windows container絕對會是首選 Switch to Linux Containers\Windows Containers 基本上想要用Windows container還是Linux container 其實可以在安裝完後自由地作切換,  由於Docker 是個Client\Server的架構, 我們在命令列上下的Docker指令, 其實就是在操作Docker Client, 而Docker Client會去跟Docker Server(Docker Engine)溝通, 比如叫它去建立Image或是停止一個container instance 在安裝完Docker For Windows之後, 除了Windows 的Docker Server之外, Windows上會多建一個Linux的虛擬機器提供Docker Server讓我們可以去使用Linux 的container 打開Hyper-V可以看到Docker安裝包幫我們建立的Linux虛擬機器 確認目前Docker Client是連接到哪個Docker Server 我們可以使用以下指令來確認 docker version 目前Client是連接到Windows 的Docker Server 若在這個時候想...

Windows 無法遠端連線 This could be due to CredSSP encryption oracle remediation

當你嘗試遠端連線時, 若出現一下錯誤訊息時, 切記末慌末害怕, 將頁面拉到最底下可以看到一串指令, 打開Command Prompt 執行, 就能解決這個問題 This could be due to CredSSP encryption oracle remediation Step 1. 以系統管理員的權限打開Command Prompt Step 2. 敲入以下指令 reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters" /f /v AllowEncryptionOracle /t REG_DWORD /d 2

如何避免Windows 10 更新, 自動重新啟動

前言 微軟不知道自從Windows 10 哪一版之後開始強迫使用者更新到最新版, 說實話, 這個非常惱人, 有時候你工作做到一半東西都還沒存檔, 隔天來上班時發現, 挖考~系統被重啟了, 全部心血直接泡湯 想避免這問題可以在鍵盤上同時按 Windows+X 然後在按 A. 此時會跳出命令列視窗 複製以下的指令並且按Enter執行 reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v NoAutoRebootWithLoggedOnUsers /t REG_DWORD /d 0 /f

Where to find the file location of .appref-ms

If you use Windows, you probably have seen this kind of file extension .appref-ms You might be interested in where they are after installing them. Basic, such files are located in  AppData\Local\Apps It's not tricky to find it, you just type %localappdata%\Apps then digging into the folder... Or you could just use Task Manager to help you find them 1. Press Ctrl + R 2. Enter Task Manager 3. Find the program 4. Right Click and choose Open File Location Here it is!

How to change the screen resolution over a remote session

This article shows how to change the screen resolution from a remote session. Step 1. Click the Show options Step 2. Click the Display option. As you can see, you can adjust the screen resolution in Display configuration

How to Reinstall Ubuntu on Window 10

Step 1. Uninstall ubuntu Open Command Prompt (Or Window PowerShell) and type > lxrun /uninstall Type "y" to continue: y If you'd like to completely uninstall Ubuntu that including user account information, you can use /full option > lxrun /uninstall /full Step 2. Install Ubuntu Type bash on Cortana search bar and click "bash" After that, you will see the message like "This will install Ubuntu on Windows, distributed by Canonical ..."

[Resolved] No such file or directory when using Ubuntu on Windows

When I performed my .sh file, I got the following error: andy@DESKTOP-ABGRI18 : /mnt/c/Users/andyl/Downloads$ sh mydeploy1.sh mkdir: cannot create directory ‘temp\r’: No such file or directory The reason is most likely my .sh file has some /r characters so that Ubuntu can't understand. There is a pretty simple way to solve this problem.  I just removed these /r characters by sed command and then everything works fine. For example andy@DESKTOP-ABGRI18 : /mnt/c/Users/andyl/Downloads$ sed $'s/\r$//' ./mydeploy1.sh > ./ mydeploy1.new.sh

Use Ubuntu on windows

If you use Ubuntu on windows, you will find the windows system drive and the other connected drives are mounted on /mnt/ directory. It means that if you want to access a file and its path is like C:\abc.txt, you have to change the working directory mnt/c.