Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Batch file 在Windows批处理脚本中追加_Batch File_Append - Fatal编程技术网

Batch file 在Windows批处理脚本中追加

Batch file 在Windows批处理脚本中追加,batch-file,append,Batch File,Append,我试图在一台计算机上编写所有程序,并将这些程序名附加到“programs.txt”文件中的文本中。现在,代码正在删除当前文本并将程序名放入文本文件中。我想它附加的程序名,所以如果有人知道如何调整下面的代码附加,我很感激的信息 wmic /output:C:\Users\Jerry\Desktop\programs.txt product get name,version 试着这样做: wmic product get name,version >>"C:\Users\Jerry\D

我试图在一台计算机上编写所有程序,并将这些程序名附加到“programs.txt”文件中的文本中。现在,代码正在删除当前文本并将程序名放入文本文件中。我想它附加的程序名,所以如果有人知道如何调整下面的代码附加,我很感激的信息

wmic /output:C:\Users\Jerry\Desktop\programs.txt product get name,version
试着这样做:

wmic product get name,version >>"C:\Users\Jerry\Desktop\programs.txt"
更好的解决方案是分两步完成(WMIC的Unicode输出原因):

wmic /output:C:\Users\Jerry\Desktop\temp.txt product get name,version
type "C:\Users\Jerry\Desktop\temp.txt">>"C:\Users\Jerry\Desktop\programs.txt"