I know this sounds fishy, but I'm trying to run a batch file from a website. Our users are seniors that wouldn't know how to do anything with a computer. Our software is a replacement for the windows shell. When the computer starts, it automatically starts our software and nothing else. Our users never see windows, only our application. It is written in C# and after presenting a login screen shows the user a full-screen web application.
We have a system where we update our application via a batch file it downloads by itself. However, the dialog window asking the user for an update is broken (minimized, so the user doesn't see it). Now our users can't update our application. We fixed this bug in the current version, but users can't get the new version.
Is there any way to run a batch file from a website? The batch file is already downloaded by our application, it just needs to run. It is located in c:/users/the_user/appdata/roaming/. If anyone has any idea how we could run the batch file remotely, that would be awesome.
I know it would be a huge security risk if something like this is possible, please don't point that out to me. It is also not their computer that runs the software, but one we provide for the purpose of the application. If a user does not want to use the app anymore, we take the computer back as well. There can not be any personal data saved on it, because there is simply no way for the user to get it on there.
Our update process goes like this: the C# app downloads a zip from our web-server if there is a new version -> the app asks the user if he/she wants to install that update -> if the user presses yes, the c# app closes and runs the batch file that copies the contents from the zip to the folder where our c# app resides -> at the end of the batch file is a system restart command, after restarting the tablet our app starts up and the user can continue using it.
No, it can't launch a batch file from a website.
A browser will just save it to the local drive or open it in the web page.
Related
I want to open files from webpage. For example when we try to download a torrent file it redirects us to utorrent app and it continues it work. I also want to open a local file somehow using OS software. Like a video file using pot player. Is there any possible solution for me ,like making a autorun in pc to run that . Anything it may be please help me.😔😔
I searched and found a solution to open a software using protocol, but in this way I cannot open a file in that software.
Opening a specific file in a specific software would usually depend on passing some URL parameters to the protocol-URL of the app (e.g., opening a file in VSCode would use a URL like vscode:///Users/me/file.html, but this functionality would have to be explicitly handled by the app itself though, so the solution for each app would be different).
Otherwise, if the app doesn't support opening a specific file itself through a URL, you'd have to use some scripting software (e.g. AppleScript if you're on macOS) to dynamically click/open certain programs on a user's computer.
the link acts as a magnet so your torrent application is opened maybe delete torrent for sometime till you finish the project, i know how to open image in local files in html but it will only be visible to you, you can do audio and video files also using <source src="movie.mp4 and on next line `type="video/mp4">
Let me give you an example of the flow I am trying to achieve:
A user enters the website
The user has everything loaded (both files and network requests)
Files are now cached due to fetch event listener
The user installs the app on their phone (so far everything works as expected)
All the data that has already been fetched by the user is transferred to the app so that the user could launch the app in offline mode.
Currently, the last step is not working. User must open the app at least once whilst online in order to make it work. Is it possible to "transfer" the website's cache to the app? If so, could you nudge me in the right direction with some helpful links? Thanks!
someone knows how to open a program that is installed on the desktop from a web page, something like the onedrive option where from the web you can tell them to open a document and open word with that document or like when you open a torrent link ?
You basically have to download a file that is recognized by the program you wish to start. That program has to be pre-installed on the machine. The file should include instructions the program understand, and can execute.
In any case, this is quite fragile, and depends on many variables you have little control over, including the user, who might decline the download, or just save the file without opening it. So you should try a different approach to achieve what you want, than running a program on a user's computer.
I need this:
The user inserts a USB drive in his PC. Then, it autoruns a .html
page in user's default browser. In the HTML page there are two
buttons: if the user presses button 1, I need to copy files to local
disk and then run these. If the user presses button 2, I need to call
a file from local disk.
I know how can autorun a .html file from USB memory. But 1) how can I copy files from HTML to local disk, and 2) how can I run files from local disk using HTML? (in Chrome, Firefox and IE).
Thanks!
Purely from HTML you will not be able to execute commands on your computer.
In order to do that, you'd need to start a daemon on your computer that would answer HTTP requests from the browser and execute commands accordingly.
Or you'd need to have plugin for the browser that would do that, but I'm not sure whether plugins are able to escape the browser sandbox. Even if they could, the solution would be browser specific.
I have a web page containing a list of pictures urls (can be more then 1000 items) and I want to enable a button for the user to click and download all of the files to the local hard drive.
The download process should ask the user for a directory to save the files in and then go ahead and download all files to that directory (if possible, creating sub directories inside). This should be done with a single user confirmation for the whole download process and avoid display the browser save dialog for each file.
Is there a way doing that? I am aware I can't use the standard HTTP protocol for the downloads and have to write some kind of control to do the job. The page is written in asp.net.
Downloading to the server, packing and sending to the user is not possible. The download has to be originated from the client machine.
You should update your question to include the requirements from your comment, because they make a huge difference. If the server cannot retrieve the files, because he doesn't have the right permissions, your only option is to run the code on the client side. There are several options how to do this, mostly depending on the clients and your coding skill:
Flash (Not sure about the security aspect of writing to the local file system, though)
Java Webstart (Disadvantage: Clients need to have the Java runtime installed)
Browser plugin/extension (Disadvantage: You can only support a subset of browsers and the page will not be immediately usable, as the plugin or extension needs to be installed first)
In all cases, you will have to write a tool, that retrieves the URL list from your server and starts downloading it.