追加在Windows批处理脚本 [英] Appending in a Windows Batch Script

查看:216
本文介绍了追加在Windows批处理脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想写一个电脑上的所有程序和APPEND这些程序名称的文本中的'programs.txt'文件。眼下,code为删除当前文本,并把节目名称中的文本文件。我想它追加程序名,因此,如果任何人知道如何调整低于code追加,我AP preciate的信息。

  WMIC /output:C:\\Users\\Jerry\\Desktop\\programs.txt产品获得名称,版本


解决方案

尝试这样的:

  WMIC产品获得名称,版本>>C:\\用户\\杰里\\桌面\\ programs.txt

有一个更好的解决方案将是做在2个步骤(WMIC的UNI code输出的原因):

  WMIC /output:C:\\Users\\Jerry\\Desktop\\temp.txt产品获得名称,版本
键入C:\\用户\\杰里\\桌面\\ TEMP.TXT>>C:\\用户\\杰里\\桌面\\ programs.txt

I'm trying to write all the programs on a computer, and APPEND those programs names to the text in the 'programs.txt' file. Right now, the code is deleting the current text and putting the program names in the text file. I would like it to append the program names, so if anyone knows how to adjust the below code to append, I'd appreciate the info.

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

解决方案

Try like this :

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

A better solution will be to do it in 2 steps (cause of the Unicode output of WMIC) :

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"

这篇关于追加在Windows批处理脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆