我正在使用命令提示符中的echo命令,在桌面上创建hello_world.txt文件,并提供以下输入:
echo hello world > C:\Users\user\Desktop\hello_world.txt
第一个代码有效,然后我尝试使用%userprofile%。比如,我想把它给另一个用户。
echo hello world > C:\Users\%userprofile%\Desktop\hello_world.txt
这个方法不起作用。是否有简单的echo命令行可以创建文本文件?
git bash
。您将拥有所有的Linux命令,并且像echo hello world > C:\Users\user\Desktop\hello_world.txt
这样的命令通常都能正常工作 ;) - Guillaume Munsch