Skip to content

Commit

Permalink
'update'
Browse files Browse the repository at this point in the history
hui-shao committed Aug 8, 2019
0 parents commit b025bf8
Showing 18 changed files with 2,095 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
c#/.vscode
c#/修改开机提示/obj
c#/修改开机提示/bin
c#/.vs
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 hui-shao

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# welcome-words
用于修改Windows开机欢迎词

<p align="left">
<img src="https://img.shields.io/github/license/hui-shao/welcome-words?color=orange&style=for-the-badge">
<img src="https://img.shields.io/github/release/hui-shao/welcome-words?color=green&style=for-the-badge">
<img src="https://img.shields.io/badge/Platform-Windows-blue.svg?longCache=true&style=for-the-badge">
</p>

58 changes: 58 additions & 0 deletions bat/Bat版-修改开机提示.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
@echo off
title 修改开机提示语 By 浅蓝的灯
color 2f
mode con lines=33 cols=100
REM ________________________________________________________________

>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"

if '%errorlevel%' NEQ '0' (

echo 请求管理员权限...

goto UACPrompt

) else ( goto gotAdmin )

:UACPrompt

echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"

echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"

"%temp%\getadmin.vbs"
exit /B

:gotAdmin

if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
pushd "%CD%"
CD /D "%~dp0"
goto A

REM ________________________________________________________________

:A
echo.
echo.
echo 使用说明:请按提示依次输入以下内容,输入完成后请 按回车键确认
ping 127.0.0.1 /n 3 >nul
echo.
echo ============By 浅蓝的灯==============
echo.
set /p caption=开机时显示的标题:
echo.
set /p contents=开机时显示的内容:
echo.
echo ----------------------------------------------
echo.
echo 正在修改注册表项……请等待
echo.
echo.
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "LegalNoticeCaption" /d %caption% /t REG_SZ /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "LegalNoticeText" /d %contents% /t REG_SZ /f
ping 127.0.0.1 /n 4 >nul
echo.
echo 运行完毕,5秒后自动退出……
ping 127.0.0.1 /n 6 >nul
exit
25 changes: 25 additions & 0 deletions c#/修改开机提示.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2035
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "修改开机提示", "修改开机提示\修改开机提示.csproj", "{68BBC422-A7E8-4489-BBFC-54D42DCD40C4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{68BBC422-A7E8-4489-BBFC-54D42DCD40C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{68BBC422-A7E8-4489-BBFC-54D42DCD40C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{68BBC422-A7E8-4489-BBFC-54D42DCD40C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{68BBC422-A7E8-4489-BBFC-54D42DCD40C4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0A352430-F72A-417A-AD06-B28BC7890087}
EndGlobalSection
EndGlobal
175 changes: 175 additions & 0 deletions c#/修改开机提示/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

69 changes: 69 additions & 0 deletions c#/修改开机提示/Form1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.Win32;

namespace 修改开机提示
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{

button1.Text = "Wait ……";
DialogResult result;//设置局部变量 result为对话框结果
result = MessageBox.Show("即将写入注册表,若有安全软件拦截请允许!是否继续?", "重要提示:", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

if (result == DialogResult.Yes)
{
//确认以后正式开始写表
RegistryKey key = Registry.LocalMachine;
RegistryKey openpath = key.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", true);//打开要新建值的项
openpath.SetValue("LegalNoticeCaption", textBox1.Text);//新建名为 LegalNoticeCaption 的值,数据为 文本框1(标题) 内容
openpath.SetValue("LegalNoticeText", textBox2.Text);


//验证一下成功写入了没
string info_caption = "";
string info_text = "";
info_caption = openpath.GetValue("LegalNoticeCaption").ToString();
info_text = openpath.GetValue("LegalNoticeText").ToString();

if (info_caption == textBox1 .Text && info_text == textBox2.Text )
{
MessageBox.Show("修改成功", "结果验证:", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
else
{
MessageBox.Show("修改失败,建议手动确认或修改", "结果验证:", MessageBoxButtons.OK, MessageBoxIcon.Error);
}

openpath.Close();

}
else
{
MessageBox.Show("您选择了取消操作","提示:", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}

button1.Text = "< 一键执行 >";
}

private void Form1_Load(object sender, EventArgs e)
{
textBox1.Text = "建议先阅读下方Tips……";
textBox2.Text = "建议先阅读下方Tips……";
}

}
}
Loading

0 comments on commit b025bf8

Please sign in to comment.