回答“复制副本".以编程方式 [英] Answer "Copy Con" programmatically

查看:64
本文介绍了回答“复制副本".以编程方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

复制con C:\ syslog \%Name%.ps1行下面的行,应该将这些行输入到文件中,但不会.发生的事情是停止并等待我键入 然后,这些线打到< CTR< Z>.关闭文件.

Lines below the Copy con C:\syslog\%Name%.ps1 line it is suppose to input those lines into the file but it doesn’t.  What happens is it stops and waits for me to type in  the lines then hit <CTR>+<Z> to close the file.

:测试
设置名称=
  set/P Name =请输入名称:%=%
 如果%Name%" ==" GOTO测试
 
 复制副本C:\%Name%.ps1
  $ computer ="%Name%" |排序对象
  Get-winEvent应用程序-计算机名"$ computer" |选择对象| ConvertTo-csv |外档C:\ csv \ Application-"$ computer" .csv
  ^ Z

:Test
set Name=
 set /P Name=Please enter the Name:%=%
 if "%Name%" == "" GOTO Test
 
 copy con C:\%Name%.ps1
 $computer = "%Name%" | sort-object
 Get-winEvent Application -computername "$computer" | select-object | ConvertTo-csv| Out-file C:\csv\Application-"$computer".csv
 ^Z

转到END

:END
暂停
退出

:END
Pause
Exit

推荐答案

感谢您的回复.

Thank you for the reply.

能否请您在这里告诉我如何使用type命令?

Could you please tell me how to use type command here?


这篇关于回答“复制副本".以编程方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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