Edi Wang

Azure Developer, Microsoft MVP


Read and Write Windows Registry in .NET Core

Yes, you read it right! It's totally possible! Even .NET Core is designed to be cross platform, but it does not mean you can not use platform specific APIs. Take Windows Registry for example, although .NET Standard can not contain Windows API like this. But there's still a way to use Windows Regisitry in .NET Core Applications. But first, you should be absolutely clear, that using platform …

Windows .NET Core Registry

Automate Windows 10 Developer Machine Setup

One of the things programmers hate most is probably setup a computer. Because the programmer's computer environment configuration is very different from normal people. In general, it takes several hours to manually install a new development machine. Let this process automating, after all, the essence of programming is to let complex things simplify, find a way to be lazy! In fact, automatic …

Windows PowerShell Choco

Install Linux Subsystem on Windows 10 Fall Creators Update

In the recent Windows 10 v1709 Fall Creators Update, the Windows subsystem for Linux has been improved a lot. Let's see how easy it is now to install Linux on Windows. 1. Enable Windows Subsystem for Linux Because the classic control panel has been hidden, now the quickest way to access Programs and Features is to run appwiz.cpl And then check "Windows Subsystem for Linux" under "Turn Windows …

Windows Linux

使用PowerShell操作Windows Event Log

PowerShell是个很牛逼的命令行工具,在Windows 7以后的系统里都默认自带。学会了PowerShell就可以提升逼格,让妹子崇拜。今天就教大家用PowerShell操作Windows的Event Log。 首先,启动PowerShell很简单,只需要在开始菜单里输入Power,就能找到了(Windows 8用户可以直接在开始屏幕里搜索Power)。 启动PowerShell后,你可以看到一个这样的界面。和CMD不同,它是深蓝色背景的,并且路径前多了PS前缀。看起来很厉害的样子: 有用程序写过Windows Event Log的童鞋都知道,我们的首要任务是创建一个Log和一个Source。PowerShell里语法如下: new-eventlog -LogName 日志名称 -Source 源名称 比如,我们创建一个Name为Game,Source为CS的Log,可以这样写: …

Windows PowerShell EventLog


我们电脑里常常有些重要数据需要定期备份,然而每次都人工操作非常麻烦。并且,在有的特殊情况下,没有办法人工操作(比如公司下班以后,在没人的时候希望服务器做一些数据备份操作)。所以我们需要让Windows自己来完成这些重复性的劳动。 本文的示例是我自己的博客项目,我将创建一个批处理,用于把“E:\WebProject\EdiBlog”文件夹打包压缩,并按日期建立备份文件夹。之后创建一个计划任务,让Windows每天晚上9点运行这个批处理。 首先,批处理很简单,代码如下,将它保存为RunBackup.bat @echo off @SET EXEPATH="C:\Program Files\7-Zip\7z.exe" @SET PROJECTPATH="E:\WebProject\EdiBlog" %EXEPATH% a -tzip "G:\EdiBlogBackup\%date:~0,4%- …


  • 1