Create Shortcut Using Batch Script in Windows

shotcut.bat

@echo off
 
call :create_shortcut "Z:\port\d\7-Zip\"	7zFM.exe	C:\Users\eu\Desktop\ 7z
 
pause
exit
 
:create_shortcut
	set src_dir=%1%
	set src_file=%2%
	set dst_dir=%3%
	set dst_file=%4%
 
	echo "%src_dir%%src_file% => %dst_dir%%dst_file%"
 
	shotcut_func.vbs %src_dir% %src_file% %dst_dir% %dst_file%

	rem echo [InternetShortcut] >> %shortcut%
	rem echo URL="%source%" >> %shortcut%
	rem echo IconFile=%source% >> %shortcut%
	rem echo IconIndex=20 >> %shortcut%

shotcut_func.vbs

src_dir = wscript.arguments(0)
src_file = wscript.arguments(1)
dst_dir = wscript.arguments(2)
dst_file = wscript.arguments(3)
 
Set oWS = WScript.CreateObject("WScript.Shell")
sLinkFile = dst_dir + dst_file + ".lnk"
Set oLink = oWS.CreateShortcut(sLinkFile)
 
oLink.TargetPath = src_dir + src_file
' optional shortcut properties
' oLink.Arguments = ""
' oLink.IconLocation = src_dir + src_file + ", 2"
' oLink.WindowStyle = "1"
oLink.WorkingDirectory = src_dir
oLink.Save

refresh_icons.bat

taskkill /f /im explorer.exe
 
attrib -h -s -r "%userprofile%\AppData\Local\IconCache.db"
del /f "%userprofile%\AppData\Local\IconCache.db"
attrib /s /d -h -s -r "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\*"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_32.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_96.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_102.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_256.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_1024.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_idx.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_sr.db"
 
echo y | reg delete "HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v IconStreams
echo y | reg delete "HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v PastIconsStream
 
start explorer

refer to:
https://serverfault.com/questions/171775/create-a-windows-shortcut-through-a-batch-file-bat
https://wenwen.sogou.com/z/q813141367.htm
https://www.2cto.com/kf/201307/225348.html
https://zhuanlan.zhihu.com/p/72426926

Dll Number Relative to Visual C++ Redistributable

MSVCR80.dll	Visual Studio 2005	8.0
MSVCR90.dll	Visual Studio 2008	9.0
MSVCR100.dll	Visual Studio 2010	10.0
MSVCR110.dll	Visual Studio 2012	11.0
MSVCR120.dll	Visual Studio 2013	12.0
MSVCR140.dll	Visual Studio 2015	14.0
MSVCR150.dll	Visual Studio 2017	15.0

refer to:
http://portal.digitser.cn/article-2038-1.html

English Words Memo

meme		网红
radical		部首
B.C.E		before common era
C.E		common era
B.C.		before Christ
A.D.		anno domini
cover		报道,平仓
pan		平移
streak		手气
audience	观众
Toronto		tornado
toll		troll
election	electron
patrol		petrol
franchise	特别经营权
helm		overwhelm
assess		access
spat		expat
pillar		pillow
pension		养老金
pregnant	pregnable
uninhabited	uninhibited
fortune		future
tear		tease
edge		渐渐移动
hiring spree	招聘热潮
due diligence	尽职调查
debt		debut
chevrons	尖括号
contain		遏制
eligible	neglectable
vapor		viper
elixir		灵丹妙药
proceeds	收益
scores of	几十个
reckoning	清算,报应
corner		囤货
ravage		savage		average
offset		抵消
have a fit	大吃一惊
far between	很分散
dairy		diary
shortlisted	入围的
benchmark	基准
fledgling	fudge		hedge
infraction	fraction	friction
falter
as much as	最多
whatever	无论/所有
chicken feed	蝇头小利
grumble		不情愿做
indignant	diligent
repulsive	reputable
bread		breadth		breath
identity	恒等式
Debt ceiling impasse weighs on major indices		债务上限僵局拖累主要指数
no death could be more certain				没有比死亡更确定的了
Tax Credit Eligible
to say nothing of					更不用说
suffice it to say that					简单而言
re-entry of incarcerated women
homeless alleviation
hunger relief
acknowledge my debt to the students
break even

English Grammar Memo

名词性从句可分为主语从句、表语从句、宾语从句和同位语从句。

宾语从句	I think (that) you're beautiful.
同位语从句	The idea that computers can recognize human voices surprises many people.	此that一般不省略
 
定语从句	You are the girl (that) I love.
		The cat that is eating an apple is cute.	此that不能省略
		I saw a man (who/that was) crossing the street.
		We buried the soldier (who/that was) shot to death.
		She is the one (who/that is) to speak.
		a cat (that is) on the table
		something (that is) blue

Windows unnecessary services

XTUOCDriverService				XtuService	Intel(R) Overclocking Component Service
Intel(R) Audio Service
SysMain						Maintains and improves system performance over time.
Netlogon
Still Image Acquisition Events
Smart Card
Payments and NFC/SE Manager
Remote Access Connection Manager
Remote Desktop Services
//Security Accounts Manager			if this service is down, we will wait for too long time to see the desktop after logging in.
//Microsoft Office Click-to-Run Service		if this service is down, we cannot open Word and Excel.
//Update Orchestrator Service
Phone Service
Xbox Live Auth Manager
Xbox Accessory Management Service
Xbox Live Networking Service
Xbox Live Game Save
Windows Management Instrumentation		wmi provider host
Windows Image Acquisition (WIA)
Windows Insider Service
Windows Error Reporting Service
Windows Mobile Hotspot Service
Windows Push Notifications System Service
Windows Backup
Windows Media Player Network Sharing Service
Windows Mixed Reality OpenXR Service
Windows Perception Simulation Service
Windows Perception Service
BitLocker Drive Encryption Service
Telephony
Themes
Radio Management Service
Diagnostic Policy Service
Diagnostic Service Host
Diagnostic System Host
Retail Demo Service
Spatial Data Service
Geolocation Service
Printer Extensions and Notifications
Inventory and Compatibility Appraisal service
Program Compatibility Assistant Service
WWAN AutoConfig
Problem Reports Control Panel Support
PNRP Machine Name Publication Service
Cellular Time
Print Spooler
Visual Studio Standard Collector Service 150
Downloaded Maps Manager
Google Chrome Elevation Service
Dolby DAX API Service
Recommended Troubleshooting Service
Remote Registry
Secondary Logon
Parental Controls
Diagnostic Execution Service
WalletService

If we want to enable Restore service in win7, we need to start below services in advance,

Windows Event Log
Task Scheduler
Background Intelligent Transfer Service
Block Level Backup Engine Service
Microsoft Software Shadow Copy Provider
Volume Shadow Copy
Windows Backup

If the language input toolbar disappears, run ctfmon.exe, which means Common Trace Facility Monitor.

If Microsoft IME CPU usage is high, turn on below service,

Touch Keyboard and Handwriting Panel Service

System.Runtime.InteropServices.COMException (0x80070422), turn on

Windows Management Instrumentation

If the system is failed to start, restore it in safe mode like this,

sfc /SCANNOW
Dism /Online /Cleanup-Image /ScanHealth
Dism /Online /Cleanup-Image /CheckHealth
DISM /Online /Cleanup-image /RestoreHealth
sfc /SCANNOW

refer to:
https://answers.microsoft.com/zh-hans/windows/forum/windows_10-performance/windows10%E5%9C%A8%E5%BC%80%E6%9C%BA%E8%BF%87/44870fe8-b64b-4c9e-bbdc-f8f5761947fc
https://www.cnblogs.com/endv/p/14196573.html

Automatic Compilation in local Gitlab

1
2
3
4
5
6
7
8
9
#prerequisite, openssh-server
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
sudo apt-get install gitlab-ce
 
#sudo vim /etc/gitlab/gitlab.rb
# change external_url to local ip.
 
sudo gitlab-ctl reconfigure
#sudo cat /etc/gitlab/initial_root_password

Open browser, visit http://localhost, login as 'root'.

Admin -> CI/CD -> Runners -> Register an instance runner, and get the registration token.

1
2
3
curl -L "https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh" | sudo bash
sudo apt-get install gitlab-runner
sudo gitlab-runner register

.gitlab-ci.yml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
stages:
  - deps
  - build
  - test
  - deploy

cache:
  paths:
    - include
    - lib
    - bin

build-deps:
  stage: deps
  script:
    - echo "will build include and lib to parent directory..."
    - cd 3rdParty; ./build_all.sh

build-job:
  stage: build
  script:
    - g++ helloworld.cpp -o bin/helloworld

unit-test-job:
  stage: test
  script:
    - chmod +x helloworld.sh
    - ./helloworld.sh

lint-test-job:
  stage: test
  script:
    - sleep 10

deploy-job:
  stage: deploy
  environment: production
  script:
    - ./pack.sh
  artifacts:
    paths:
      - bin.tgz
    expire_in: 4 days

refer to:
https://blog.csdn.net/weixin_47358139/article/details/126267861
https://blog.csdn.net/qq_42001163/article/details/122938040
https://blog.51cto.com/flyfish225/2145495
https://blog.csdn.net/zyy247796143/article/details/123842374