用cmd打开TXT(中文)文件,以及创建空文件,删除文件,改变输入法

编码               十进制

ut-8                65001

GBK               936

美国英语        437

 

 

windows cmd 默认为GBK

我这有一个本地a.TXT, 以及一个从网上下载的b.txt.

 

 

首先   cd 到两个文件所在目录

 

然后打开两个文件

可以看到本地文件正常显示

而从网上下载的为乱码(因为编码为utf-8)

 

更改cmd编码方式

更改完成

再次打开两个文件呢

这次a.txt变成了乱码

 

 而b.txt 则变成了简体中文

 

原因在于chcp 65001

但这种变换方式只是临时的!!!!!!

 

关于创建一个新文件: type nul > abc.txt 这样就创建了一个名为abc.txt 的文件

删除文件 :  del abc.txt 这样就删除了名为abc.txt 的文件

如果要在 cmd 命令行下输入中文, 按住 Ctrl + Shift 就可以,我的是win10 的系统。

 

 

一些基本的命令:

shutdown the computer after 10 seconds:

shutdown /s /t 10

 

bibernation the computer with forcing the complication to be close:

shutdown /h /f

 

restart the computer after 10 seconds:

shutdown /r /t 10

 

start the firefox.exe:

start firefox.exe

 

start a webpage :

start http://..............

 

show WIFI used:

netsh wlan show profiles

 

show the secret which have been used"

netsh wlan show profile name  ="" key = clear

 

connect the WIFi:

netsh wlan connect name =""

 

posted @   看星星的派大星  阅读(6101)  评论(0编辑  收藏  举报
编辑推荐:
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
点击右上角即可分享
微信分享提示