Run a program from a local webpage - html

I'm trying to use a webpage as an entry point for a kiosk. The HTML will be run in local, I need two things:
<a href="c:\Users\Admin\Documents">...
Which works like a charm
And..
<a href="c:\Program Files\Windows Live\Mail\wlmail.exe">...
(program just an example, all programs are the same)
Which works but.. it prompts to download the file then you are prompted to start it.. Is there any way to do this directly, like click and bam you opened notepad.exe? Maybe using a Java applet?
EDIT:
I know it can't be done remotely, I'm talking about local files.
The file will be accessed as c:\myhtml.html
And will open ONLY already installed files, nothing from the web.

If i get your question right , the closest thing to get what you want would be using *.hta which is a HTML Application that runs outside the browser window just like a normal app.
<script type="text/javascript" language="javascript">
function RunFile() {
WshShell = new ActiveXObject("WScript.Shell");
WshShell.Run("c:/windows/system32/notepad.exe", 1, false);
}
</script>
Bit more info here:
http://www.kunal-chowdhury.com/2010/09/how-to-execute-local-file-using-html.html

The right way to implement this is by creating custom protocol in Windows. Details in the MSDN article "Registering an Application to a URI Scheme"

No, this is security issue, browsers don't allow it because it could be security risk to run apps without prompt, just by clicking on the link.
There are several technologies like java WebStart and ASP ClickOnce - they will install the app more or less automatically, signing the application helps too - the messages the user gets look less scary.

Correct me if I didn't understand you. If you're running the web page locally (http:\127.0.0.1) and want to execute a program in the same machine, it will depend on the technology that you're using, for example in php you could use exec() to execute a program on user input but it will run on the server side.

Related

Zabbix Run a script to call Exe from my local computer

I have some computers and all have RDP enabled. So Id like to link to create a script to call a command from my local computer, like "C:\Windows\system32\mstsc.exe {HOST.CONN}"
but i dont know how to call a .exe from my own computer.
Is this possible?
how i imagine add rdp option
It's an useful idea, but Zabbix is not quite there yet. You would need to use a URL field, but there is no URL field in the Host, only in the Problem. You also need a Custom protocol handler in chrome (or your favourite browser, almost same procedure).
To add an URL field in the menĂ¹ you highlighted, you may use TamperMonkey (client side) or fiddle with the zabbix-web source code (server side). I'd use TamperMonkey because editing the source code will not survive a package upgrade.

Filemaker Using Web Viewer to build Database Navigation Menu Using Callback URLs

I would like to use the Filemaker web viewer to build and style a database navigation menu. I have found a handful of samples and I have played with the code but the problem that I am having is that it launches in another window (Note that I also have several versions of Filemaker on my desktop and it also tries to launch the pop up in Filemaker 13 when I am building in Filemaker 12).
The goal is to call the script inside of the current database and current application so that it functions as a system navigation menu. In straight HTML in a site environment I would add target="_blank" or target="_parent" to the href but I can't seem to get the syntax right to try it in the web viewer and I'm not sure if this would be the solution. Can any angel from tech heaven assist or offer any advice? Here is the sample code that I currently have that calls a Filemaker script in a local system for a google map interface. I'll be using the script differently but the structure will be the same.
"data:text/html," &"
<html>
<body>
<a href='"&"FMP://" &
Case(
IsEmpty(Get(HostIPAddress)); Get(SystemIPAddress);
not IsEmpty(Get(HostIPAddress)); Get(HostIPAddress);
)
&"/"& Get ( FileName )& "?script=Open-Detail-Map&param=" & Data::ID_Data&"'>View Map
Detail</a>
</body>
</html>"
This works for me, and it opens it in the same window. I'd recommend using FileMaker 13 for development, or uninstalling it. It launches in 13 because the URL protocol handler (FMP) is the same for both versions, so your OS uses the newest version of FileMaker to handle the URL call.
Note that triggering scripts using a URL will not work in standalone files in FileMaker Pro, only hosted files or FileMaker Go.
It is possible to call the script from another file directly in FileMaker, rather than trying to do it from a webviewer. Can you clarify why you're trying to create your navigation menu in a webviewer?
If a webviewer is not compulsory, I would recommend:
creating an External Data Source that points at the other file
Adding FileMaker buttons for your navigation
Right-click on the button you want to trigger the script, and choose "Button Setup", then choose "Perform a Script" and specify the script you want to run from the other file.
Honestly, this makes no real sense to do. I get what you are trying and it seems interesting, but build your navigation in FileMaker and display your banner ads in a web viewer. The other option, which is always available, is to just build out the solution as a PHP site using the FMP PHP API.
I realize that this is an answer for a rather old question, but I think it warrants pointing out what the solution here is...at least in modern versions of FileMaker. I don't recall exactly when this was fixed...13.05 or .06? It was present in earlier versions but wouldn't work for locally opened files, only hosted files; now it works in both.
You need to use the 'currently open file' reference in the FMP URL: "$". So your URL string should look like this:
"fmp://$/fileName?script=AScriptName&param=..."
In your code:
<a href='"&"FMP://" &
If ( IsEmpty(Get(HostIPAddress)); "$"; Get(HostIPAddress) )
&"/"& Get ( FileName )& "?script=Open-Detail-Map&param=" & Data::ID_Data&"'>View Map Detail</a>

ChromeCast: Chrome sample project not running

I am following the setup instructions here: https://github.com/googlecast/CastHelloText-chrome step by step.
I have my Google Drive hosting folder here: https://drive.google.com/folderview?id=0ByI6ac75SrewSE1odEdBMm1fNk0&usp=sharing
I set my URL (for my application in the developer console) to https://googledrive.com/host/0ByI6ac75SrewSE1odEdBMm1fNk0/receiver.html
However, when I run my chromehellotext: https://googledrive.com/host/0ByI6ac75SrewSE1odEdBMm1fNk0/chromehellotext.html
I get this error in the console: "onError: {"code":"session_error","description":"NOT_FOUND","details":null}" and my Chromecast will not connect when I hit the carriage return and select my Chromecast.
What am I doing wrong?
Checking the box for sending the serial number to google solved this problem for me as well. It took me a few minutes to figure out where this box is so that I could check it. I had to download the chromecast setup application and then let it discover my device, select it, and click settings. The checkbox is in the settings.
It can take up to 6 hours to publish your receiver app. As the docs suggest, all you need to do is restart your Chromecast to force the device to reload it's configuration data. I was having this same issue and a restart was all I needed.
Make sure your receiver app is loading the cast_receiver.js javascript file as well as starting an instance of the castReceiverManager.
I was seeing that same timeout message before I did that. My initial receiver code was just static HTML, but apparently that's not good enough.
The following, in my receiver's index.html did the trick for me:
<script src="//www.gstatic.com/cast/sdk/libs/receiver/2.0.0/cast_receiver.js"></script>
<script>
window.castReceiverManager = cast.receiver.CastReceiverManager.getInstance();
window.castReceiverManager.start();
</script>
(copied from https://developers.google.com/cast/docs/custom_receiver)

HTML hyperlink to call exe with parameters

-Hello, looking for some help.
We currently have a winform app used to do approvals in our company. The app sends html emails to the "approvers" who read the relevant info in the email and click on a hyperlink which launches the app so they can do their approval.
Currently this is done by including the following in the email html:
<a href=file:///C:\Temp\test.exe>Click to Approve</a>
This correctly launches the app, after a couple of security warnings which we are OK with. We use Outlook 2010.
Now, in order to improve this process I would need to pass an argument identifying the approver to the app. This works correctly if I pass the argument from, say, a windows shortcut, however, I cannot find a way to pass the argument to the exe in the href attribute in order to do it from the email. I looked everywhere, and found nothing except questions.
I have tried the following to no avail:
<a href=file:///C:\Temp\test.exe approverID>Click to Approve</a>
<a href=file:///C:\Temp\test.exe 'approverID'>Click to Approve</a>
Click to Approve
Also I have tried doing it with JavaScript, which from an HTML page works fine, but not from an email in Outlook.
I thought maybe there is a security threat with this approach hence it is not possible, but if I can successfully from an email run an exe, why can I not run an exe with parameters? It doesnt make sense.
Thank you for your help.
Leo
after not getting any suitable responses and after continuing my research for this without success, I will temporarily conclude that what I am looking for is not possible. If the reasons for this not being possible concern security, then I am completely puzzled as to why running an exe without parameters is allowed and therefore considered LESS harmful than running an exe with parameters. Surely, an exe does not require parameters to be harmful. If anyone would care to elaborate on this, it would be educational for me, thank you.
Nevertheless, I have thought of an alternative to my problem, which is not as elegant as would otherwise be stating parameters in href, but it serves my purpose. Because our app is run from a network drive, I have changed it so that it creates user-specific cmd files on the network drive and the hyperlink in the email it creates points to these cmd instead of the exe. That way, the cmd files contains the call to the exe with the correct parameters and as the cmd files are very light and quickly written, this is OK.
I am closing this as "answered", but it is not.
Thanks for taking your time to read.
Leo
I recommend you take a look to "How to create a protocol and assign it an app with parameters".
Example : http://kb.mozillazine.org/Register_protocol
http://msdn.microsoft.com/en-us/library/aa767914.aspx
I have had the same problem and one alternative I have found was to create a .bat file that is attached to the e-mail that includes the command line and respective parameters, the user double-click the attachment, confirms that wants to open the file and the .bat runs. It is not as cleaner as the link but I guess It is an acceptable workaround in some cases.
Important: My OS is Win7 and e-mail client is Lotus Notes, I am not sure if this alternative works with other mail clients/OSs .

URL opening error in Flash CS4

I have a script that loads a php page for variables. There are no problems when the swf is uploaded to the site but when I run it locally, I keep getting "Error opening URL" messages. I'm using absolute pathing and if I paste the URL my script is using in a browser, the correct page opens. This only started happening after the site changed servers. Any ideas what the problem could be? Thanks.
The "Error opening URL" seems to be caused by a number of issues. I have tried to keep track of all the different solutions I have used in the past to fix the problem. Ever time I encounter the "Error opening URL" the solution is different. Hopefully one of these solutions helps you.
I usually find the following solutions on google.
- Make sure crossdomain policy is setup correctly.
- Set a bunch of variables like Security.allowDomain(domainHERE)
- Change publishing setting for your flash file.
- Make sure your connecting to the right url.
Here is what works for me... usually.
1) Make sure you are connecting to the right URL.
Use the full path, don't use relative links. Also, copy and paste the url in your web browser to see if it connects.
You can also use flash.events.HTTPStatusEvent.HTTP_STATUS to view the HTTP headers but I would recommend you check out solution 5 first. Its a much easier way with more details.
Source: http://www.judahfrangipane.com/blog/2007/02/15/error-2032-stream-error/
2) Put a crossdomain.xml file in the root of your server (usually public_html or www)
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM
"http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*"/>
</cross-domain-policy>
Source:
http://www.senocular.com/pub/adobe/crossdomain/policyfiles.html
3) While editing the flash file, press Ctrl + Shift + F12
Make sure Local playback security is set to Access Network Only.
4) If you are hosting locally using MAMP, WAMP, XAMP or something similar, skip this step. Otherwise, Call your webhost and yell at them ;)
I have hosted with godaddy, hostgator and liquidweb. It seems that all of them have some kind of firewall setup blocking flash from accessing the files you want it to.
Give your host a call, tell them your problem and ask them to whitelist the files you are trying to connect to and you should be good to go.
Remember, everytime you want to connect to a new file, it has to be whitelisted. I always forget this and it takes me 3 hours to figure out why changing the name of my file or moving it messes everything up. :)
5) Use Charles Web Debugging Proxy Program to gather some important information.
I will break this down into a few steps.
Usually for me the "Error opening URL" is due to a coding problem on the site I'm trying to connect to.
Open Charles
Run your flash file
Select the site your flash file tried to connect to in Charles side bar.
View the Response tab near the top.
On the Response tab you should see a few other tabs near the bottom. View the Headers tab.
See what HTTP_Status was returned. Then look search this page to see what that status code means. It will give a somewhat broad definition but it still helps narrow things down.
500 Means a problem with your server... If your server is running fine, then its most likely a code problem.
Then view the Text tab near the bottom of the Response tab. This will show you exactly what that webpage looks like to flash. If your server is in some kind of debug mode where it displays errors, this is where you will see them.
Well I hope this helps someone. I will try to continue to update it with more issues and solutions I run into. This is probably the number one problem I run into with flash. Super annoying!
Crossdomains.xml file possibly?
not really a solution, but a work-around:
before CTRL-ENTER on your .fla, do a CTRL-S
this seems to work about 90% of the time for me
NOTE: I never had this problem until one random day about 6 months ago. Now it plagues most of my old projects, cs4 or cs6.