1

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.

James A Mohler
  • 11,060
  • 15
  • 46
  • 72
Deepak Yadav
  • 1,724
  • 3
  • 23
  • 38

2 Answers2

2

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.

Nayuki
  • 17,911
  • 6
  • 53
  • 80
  • Yes I already did accept agreement, And after that it works in command prompt too, but not working with cfexecute!! – Deepak Yadav Aug 17 '11 at 17:04
  • Maybe ColdFusion is running as a different user. – Nayuki Aug 17 '11 at 17:10
  • I am able to cfexecute ping command, and Coldfusion runs under webadmin account, which I guess has all permissions. – Deepak Yadav Aug 17 '11 at 17:42
  • 1
    Do not guess ;) Log in under the *same account* CF is using. Run sdelete.exe from a command prompt. What are the results? – Leigh Aug 17 '11 at 18:06
  • 1
    You might also be able to use the "Run as" command instead of logging in. – Nayuki Aug 17 '11 at 18:37
  • Thanks Leigh and Nayuki. @Leigh: right I should never guess :) ,@Nayuki: I run it as webadmin and have to click 'Agree' before using cfexecute – Deepak Yadav Aug 17 '11 at 19:23
  • @Deepak - You mean you are prompted *every* time? From what I have read, there is no flag to disable the agreement prompt. The suggestion is trying a registry hack http://forum.sysinternals.com/topic10083&OB=DESC.html or http://social.msdn.microsoft.com/Forums/en/netfxbcl/thread/70b2419e-cb1a-4678-b2ae-cedcfe08d06f – Leigh Aug 17 '11 at 19:46
  • Nono, you are prompted only once per Windows user account. The problem was that the web server process was running under a different account. – Nayuki Aug 17 '11 at 20:28
  • Lol. Yes, that is what I *expected* to happen. But his last response made it sound like that was *not* what actually *did* happen ;) – Leigh Aug 17 '11 at 22:52
0

Add a timeout value to cfexecute

ie timeout="100"

James A Mohler
  • 11,060
  • 15
  • 46
  • 72