Windows - Open exe, bat and all other program files from your intranet

It is common to have a lot of shortcuts to our systems on the intranet.
It is easy to publish web applications but it is hard to put together all desktops programs.
To make easy this task you have to to 3 steps:

1 - Create a batch file and put this in a share which everybody has access;

2 - Add in your Windows desktops a registry file, this file will contain an URI definition that will make possible the workstations understand what to do with the instruction from html link.

3 - Create a link in your intranet, or create a HTML file with a link to test.


1 - Batch file: create a batch file like this example.

for /F "tokens=2 delims=: " %%a in ("%1%") do (
rem this step will get the program from instruction
set startProgram=%%a
)
rem this step will replace / for \
set htmlProgram=%startProgram:/=\%
start %startProgram%


2 - Windows registry: Create a .reg file with a text like this example.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\yourcompany]
@="URL:yourcompany"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\yourcompany\shell]

[HKEY_CLASSES_ROOT\yourcompany\shell\open]

[HKEY_CLASSES_ROOT\yourcompany\shell\open\command]
@="\\\\server\\share\\yourbatch.bat %1"



3 - HTML Link: just create a HTML link like the example below, if you need to put full path you have to use / instead \. Ex.: //server/share/yourprogram.exe


<a href="yourcompany:notepad">Notepad in my intranet</a>

Comments

Popular posts from this blog

Impacket-master - psexec for linux

Openedge (Progress) - List transaction cache