Unable to launch notepad using Cold Fusion?

We are trying to launch notepad using Cold Fusion in Windows Server 2003

Here is the code:

[COLOR=“Navy”]<span style=“font-family:Verdana, Arial, Helvetica, sans-serif; font-weight:bold”>
Attempting to launch Notepad.exe… <br /><br />
</span>

<CFX_EXEC CMD=“C:\windows\
notepad.exe” INTERACTIVE=“Y” TIMEOUT=0 USER=“UserName” PWD=“password” DOMAIN=“Domain”>[/COLOR]

Where in the above code:

Username is a process account and member of Domain Users only.

The above code wors fine from the local machine but doesnt work in the server.

This is the error message I get:

[COLOR=“red”]Attempting to launch Notepad.exe…

Status: ER
Message: Access is denied.
Err No: 5[/COLOR]

Can someone please help?

Cheers

A

I know nothing about that tag, but usually operations are restricted by whatever permissions the CF is running under. On windows, it’s usually SYSTEM by default.

But, are you trying to run notepad … on … the … SERVER? If so, why?

Hi cfStarlight

Thanks for comming back to me. We just need to this another Development team to open S&S POS Orderforms Builder (created in Cold Fusion) on the Server. The reason I asked for notepad is if I can open Notepad then I would be able to open S&S POS Orderforms Builder as well.

I hope it is clear. Please help.

Thanks

Sorry, but I have no idea what “S&S POS Orderforms Builder” is? :frowning:

Maybe I’m misunderstanding… but it seems like you may be going about this the wrong way. Even if you could open up notepad.exe (or a similar program) on your server - from within a CF page, the user viewing that page would never see it. All a user sees is the HTML sent from the CF server to their browser.

So notepad.exe would be open on the server, but the user sitting at their computer screen would never know that, because they cannot see what is running on the server.

To view files or programs hosted on your server, the team would need some of direct file access.

Thanks for the reply back.

“S&S POS Orderforms Builder” is a web page written in cold fusion for our development team.

Even though if it is just a HTML page. But then then can you give me some light so that I should be able to execute this on the Server?

I just need a code to execute to launch any application from the server.

Please help.

Either you’re misunderstanding me or vice versa :wink: I can’t really give you any advice, because truthfully I don’t understand what “S&S POS Orderforms Builder” is … let alone what you need to do with it.

  • What is it?
  • What does it consist of: cfm and cfc files?
  • What does the development team need to do with it: use it … or modify it?

It is a CFM file. We just need to open this file using CF.
As it is a functional code for the developers - I dont know much about this.

We just wanted to open this CFM file using CF. But again can we open any application - lets say “Word”, Notepad using CF via server?

Thanks

ColdFusion is a server-based language. It’s not a program in the same sense as Notepad, which I’d probably class as a Desktop program.

If you want to look at it generally it’s main job is to read in requests sent from a user’s browser and provide that user with customised HTML output, which is then displayed in their browser.

You’re going to need a couple of things:

a) Obviously ColdFusion installed on a server, or your local machine.

b) A way of access your files on that server/machine through a browser. In other words you can read that CFM file through an address like:

http://www.mydomain.com/orderFormsBuilder.cfm

If you’re not sure how to do that or what I’m saying doesn’t make sense then the best advice I can give you is to take a few steps back, research up on the language and try and get a better understanding of the tools you need to use.

By all means ask away if you need any help :wink:

Cheers,
James

I think I didnt explain this properly what exactly we needed. I am making it more simple:

We have Cold Fusion version 8.0 installed on one of our servers (Windows Server 2003). And we are trying to use <CFX_EXEC> tag to launch any application as a test from the server.

It works fine when we run from a local machine but fails to run when do from the server.

Here is the test code:

[B][COLOR=“Navy”]<<span style=“font-family:Verdana, Arial, Helvetica, sans-serif; font-weight:bold”>
Attempting to launch Notepad.exe… <br /><br />
</span>

<CFX_EXEC CMD=“C:\windows
notepad.exe” INTERACTIVE=“Y” TIMEOUT=0 USER=“ProcessAccount” PWD=“Process Account Password” DOMAIN=“domain.com”>

<CFOUTPUT>

<span style=“font-family:Verdana, Arial, Helvetica, sans-serif”>
<CFIF #STATUS# EQ “ER”>
<b>Status:</b> #STATUS#<br />
<b>Message:</b> #MSG#<br />
<b>Err No:</b> #ERRN#
<CFELSE>
Successful!
</CFIF> </span> </CFOUTPUT>[/COLOR][/B]

Is there anyway we can do that on the server to launch any application?

Thanks

P.S # This is how we are opening the file: [COLOR=“Blue”][U]http://localhost/3rdParty/LaunchNotepad.cfm[/U][/COLOR]

The confusion here might be the fact you’re trying to use Notepad / Applications in your example. Again like CFStarlight said what are you expecting to happen if this was successful as that’s quite important to understand this? Notepad to launch maybe?

In which case my question would be, if I was to come on your website and run this what should happen from my point of view? ColdFusion would, in theory anyway, open up Notepad on the website’s server. Seems a bit pointless as I can’t see that happening. If you / Developers think that it’s going to run Notepad on the website visitors computer it’s not going to happen!

I guess you’re using a custom tag there instead, but normally when you see CFEXECUTE (CF’s native tag) being used it’s to run things like batch scripts or getting the server’s operating system to run some kind of command / process in the background e.g. deleting files etc.

A bit of background info - A lot of hosting companies, especially shared hosting, block the use of this tag for reasons like this. They don’t want people writing scripts that can play around with things at the OS level.

It’s very likely you’ve got permission problems going on and on top of that you’re trying to run an executable file so it’s maybe worth:

a) Changing to the native tags of ColdFusion instead (CFEXECUTE). A lot more information online about that than CFX_EXEC.
b) Setting up some kind of testing batch script rather than trying to use an executable. Certaintly more of a real life example to test against and check that ColdFusion is actually managing to do the job.

Cheers,
James

Also, just reading back here, you say:

“S&S POS Orderforms Builder” is a web page written in cold fusion for our development team.

If this script you’re trying to write is also ColdFusion based then why not run whatever you / the Developers need within ColdFusion and then use the <cflocation /> tag to redirect the user into this S&S program. All this is run within the browser.

We just wanted to open this CFM file using CF. But again can we open any application - lets say “Word”, Notepad using CF via server?

Short answer is no, as it’s pointless (from a user perspective) as they’ll never seen the results outside of the server. Like I say Word and ColdFusion aren’t the same kind of applictions. Word is a Desktop Application that you launch by executing the program. ColdFusion is Server-based Programming Language that is given commands through a browser, processes those commands and then sends the results back (normally as a web page). Completely different and executed in completely different ways.

In which case my question would be, if I was to come on your website and run this what should happen from my point of view? ColdFusion would, in theory anyway, open up Notepad on the website’s server. …If you / Developers think that it’s going to run Notepad on the website visitors computer it’s not going to happen!

That is the key. A typical web page can’t open a program on a user’s computer. Imagine what a security risk that’d be if it could?

So if you put this code in a web page, on a server in California, and a developer in New York runs the page. The developer won’t see anything. Only someone who’s physically sitting in California, directly in front of the server, will see the program. So it’s rather pointless. If they’re physically sitting in front of the server, they can run it manually. This isn’t the way these tags were meant to be used.

But I’m totally confused as to why you need this tag in the first place. If as you say the application is “(created in Cold Fusion)” , why can you not just run it IN ColdFusion?

Let’s clarify what cfx_exec is meant to be used for.

It’s meant to run processes written in other languages. For example, you might have a Perl script on the server that does some task. You could kick off that script from ColdFusion using cfx_exec. This is not a “program” per so, but a process which does a task without input from the user.

What it’s NOT meant to do is to run desktop software like Notepad, or Photoshop, or something else.

As others have said, if this Orderforms Builder is built in ColdFusion, why not just integrate it into your other ColdFusion code. Or, barring that you could access the output of that page using a cfhttp call, then display it in your application.

Sorry for the late response as I was sick for the last few days.

Anyway comming back to the point:

I am not CF programmer or developer. I am assisting the CF developer regarding their query. So I would appreciate if you could give me the code so that I can execute and test it myself on the terminal server.

Just to make it more clear - any application will need to be access by our users from the terminal server not from their local machine.

As I have seen that if someone is logging into the server then it ispossible only. Please advice.

Sorry for the late response as I was sick for the last few days.

Anyway comming back to the point:

I am not CF programmer or developer. I am assisting the CF developer regarding their query. So I would appreciate if you could give me the code so that I can execute and test it myself on the terminal server.

Just to make it more clear - any application will need to be access by our users from the terminal server not from their local machine.

As I have seen that if someone is logging into the server then it ispossible only. Please advice.

Sorry for the late response as I was sick for the last few days.

Anyway comming back to the point:

I am not CF programmer or developer. I am assisting the CF developer regarding their query. So I would appreciate if you could give me the code so that I can execute and test it myself on the terminal server.

Just to make it more clear - any application will need to be access by our users from the terminal server not from their local machine.

As I have seen that if someone is logging into the server then it ispossible only. Please advice.

I’m not trying to be rude, but you don’t seem to be understanding what we’ve said. If you’re working with a CF developer, they should already be aware of everything we’ve said to you here and be able to explain to you what needs to be done.

I wouldn’t count on that starlight. CF is so easy to get up and running that it’s quite common to skip over the basics. And honestly that’s what it sounds like is happening here. Good luck bemine747.

You could be right. It’s just this is the 3rd thread I’ve seen on this topic. All with the same responses. Unfortunately, I’m just not sure how else to say “you can’t get there from here”.