sdelete.exe is not working with cfexecute

此生再无相见时 提交于 2019-12-11 06:18:54

问题


I am trying to run sdelete.exe (http://technet.microsoft.com/en-us/sysinternals/bb897443.aspx) using cfexecute, but I think cfexecute is not even running that command.

It's not giving me any permission error. And I have given all admin privileges to ColdFusion service -> logon tab.

The following is the line that I have in my .cfm page that run successfully but doesn't delete the file:

<Cfexecute name="C:\Inetpub\wwwroot\sdelete.exe" arguments="-p 2 C:\Inetpub\wwwroot\Deepak\testP\removeme.txt" outputfile="C:\Inetpub\wwwroot\Deepak\testP\out.txt"></Cfexecute>

I am able to execute it in command prompt writing:

>C:\Inetpub\wwwroot\sdelete.exe -p 2 C:\Inetpub\wwwroot\Deepak\testP\removeme.txt

And remove.txt is gone!

I have checked all the windows and ColdFusion logs, and didn't found anything useful.


回答1:


When sdelete starts up for the first time, it gives a GUI prompt for you to accept the license agreement.

ColdFusion is a server process, which would usually run under a different user account. So you need to run sdelete on that account and accept the agreement. To do so, you can use the Run As command.




回答2:


Add a timeout value to cfexecute

ie timeout="100"



来源:https://stackoverflow.com/questions/7096657/sdelete-exe-is-not-working-with-cfexecute

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!