释放输出目录经常使用 [英] release output directory often in use

查看:85
本文介绍了释放输出目录经常使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

该版本的最后一项任务是一个简单的"复制文件"。将setup.exe和相关文件(由squirrel生成的winform应用程序)复制到用户可以运行它的文件服务器。问题是,当用户离开该目录时,
在Windows资源管理器中打开,并且下一个版本出现时,它不能"清理目标文件夹"。因为它正在使用中。然后我们必须弄清楚它是谁, 让他们关闭Windows资源管理器,并重新部署。

The last task of the release in question is a simple "copy files" to copy the setup.exe and associated files (a winform app generated by squirrel) to a file server where the users can run it. The problem is that when a user leaves that directory open in windows explorer and the next release comes along it can't "clean target folder" because it's in use. Then we have to figure out who it is,  have them close windows explorer, and redeploy.

任何想法?在此先感谢。

Any ideas? Thanks in advance.

推荐答案

您好,

感谢您在此发帖。

您可以尝试创建脚本来关闭文件夹或终止"打开文件夹进程",然后添加任务(批处理脚本,命令行或PowerShell,基于您的脚本)来运行在"清理目标文件夹"之前的脚本。

You can try to create a script to close the folder or kill the ‘open folder process’, then add a task (Batch Script, Command Line or PowerShell, based on your script) to run the script before "clean target folder".

请参考以下主题:

  • Batch command : how to close an open folder?
  • Shell script to capture Process ID and kill it if exist
  • Help with powershell script to close open files
  • Query and kill a process on a remote computer using PowerShell and WMI

最好的问候。


这篇关于释放输出目录经常使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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