评价我的脚本:查找 Office 文件中嵌入的 Flash 文件
有人可以对此进行改进吗?需要 Sysinternals 字符串
date /T >N:\output.txt
net use z: /delete
net use z: \\svr-002\rmstudentwork
@cd /d "z:\"
"N:\Scripts and Reg Frags\FindEmbededFlashFiles\strings.exe" -s *.xls | findstr \.swf >> "N:\output.txt"
"N:\Scripts and Reg Frags\FindEmbededFlashFiles\strings.exe" -s *.ppt | findstr \.swf >> "N:\output.txt"
"N:\Scripts and Reg Frags\FindEmbededFlashFiles\strings.exe" -s *.doc | findstr \.swf >> "N:\output.txt"
"N:\Scripts and Reg Frags\FindEmbededFlashFiles\strings.exe" -s *.xlsx | findstr \.swf >> "N:\output.txt"
"N:\Scripts and Reg Frags\FindEmbededFlashFiles\strings.exe" -s *.pptx | findstr \.swf >> "N:\output.txt"
"N:\Scripts and Reg Frags\FindEmbededFlashFiles\strings.exe" -s *.docx | findstr \.swf >> "N:\output.txt"
date /T >>N:\output.txt
net use z: /delete /yes >>N:\output.txt
net use z: \\svr-003\rmstudentwork
"N:\Scripts and Reg Frags\FindEmbededFlashFiles\strings.exe" -s *.xls | findstr \.swf >> "N:\output.txt"
"N:\Scripts and Reg Frags\FindEmbededFlashFiles\strings.exe" -s *.ppt | findstr \.swf >> "N:\output.txt"
"N:\Scripts and Reg Frags\FindEmbededFlashFiles\strings.exe" -s *.doc | findstr \.swf >> "N:\output.txt"
"N:\Scripts and Reg Frags\FindEmbededFlashFiles\strings.exe" -s *.xlsx | findstr \.swf >> "N:\output.txt"
"N:\Scripts and Reg Frags\FindEmbededFlashFiles\strings.exe" -s *.pptx | findstr \.swf >> "N:\output.txt"
"N:\Scripts and Reg Frags\FindEmbededFlashFiles\strings.exe" -s *.docx | findstr \.swf >> "N:\output.txt"
net use z: /delete /yes
基本上,它会将共享安装为网络驱动器,然后在共享中运行以查找 Office 文档中的 swf 文件。
Can anyone improve on this? Requires Sysinternals Strings
date /T >N:\output.txt
net use z: /delete
net use z: \\svr-002\rmstudentwork
@cd /d "z:\"
"N:\Scripts and Reg Frags\FindEmbededFlashFiles\strings.exe" -s *.xls | findstr \.swf >> "N:\output.txt"
"N:\Scripts and Reg Frags\FindEmbededFlashFiles\strings.exe" -s *.ppt | findstr \.swf >> "N:\output.txt"
"N:\Scripts and Reg Frags\FindEmbededFlashFiles\strings.exe" -s *.doc | findstr \.swf >> "N:\output.txt"
"N:\Scripts and Reg Frags\FindEmbededFlashFiles\strings.exe" -s *.xlsx | findstr \.swf >> "N:\output.txt"
"N:\Scripts and Reg Frags\FindEmbededFlashFiles\strings.exe" -s *.pptx | findstr \.swf >> "N:\output.txt"
"N:\Scripts and Reg Frags\FindEmbededFlashFiles\strings.exe" -s *.docx | findstr \.swf >> "N:\output.txt"
date /T >>N:\output.txt
net use z: /delete /yes >>N:\output.txt
net use z: \\svr-003\rmstudentwork
"N:\Scripts and Reg Frags\FindEmbededFlashFiles\strings.exe" -s *.xls | findstr \.swf >> "N:\output.txt"
"N:\Scripts and Reg Frags\FindEmbededFlashFiles\strings.exe" -s *.ppt | findstr \.swf >> "N:\output.txt"
"N:\Scripts and Reg Frags\FindEmbededFlashFiles\strings.exe" -s *.doc | findstr \.swf >> "N:\output.txt"
"N:\Scripts and Reg Frags\FindEmbededFlashFiles\strings.exe" -s *.xlsx | findstr \.swf >> "N:\output.txt"
"N:\Scripts and Reg Frags\FindEmbededFlashFiles\strings.exe" -s *.pptx | findstr \.swf >> "N:\output.txt"
"N:\Scripts and Reg Frags\FindEmbededFlashFiles\strings.exe" -s *.docx | findstr \.swf >> "N:\output.txt"
net use z: /delete /yes
Basically it mounts a share as a network drive then runs through the share looking for swf files inside office documents.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不是批处理文件专家,但我认为您可以:
在变量中存储重复的路径:
将重复的命令替换为 FOR< /a> 循环,例如:
(请注意,此循环还替换了 strings.exe 的
@cd /d "z:\"
和-s
参数。)免责声明:我'我是凭空写下这个的,所以建议的代码可能不起作用或者可能需要额外的微调。不管怎样,我希望这能给你带来启发。
I'm not a batch file expert, but I think you could:
Store repeated paths in variables:
Replace repeated commands with a FOR loop, e.g.:
(Note that this loop also replaces
@cd /d "z:\"
and the-s
parameter of strings.exe.)Disclaimer: I'm writing this off the top of my head, so the suggested code may not work or may need additional fine-tuning. Anyway, I hope this will give you the idea.