I'm using EXE files for the back end of an in-house website.
I have server 2019 and IIS 10.
When I call the EXE file IIS tries to download the file instead of executing it.
I'm calling like this:
$.ajax({
url: "cgi-bin/compPack.exe",
dataType: "json",
type: "post",
data: dataString,
error: ajaxError,
success: function(json){
Which gives an error because it's expecting a JSON string, and if I enter
sandbox/cgi-bin/myProgram.exe
in the browser it just downloads the EXE.
I've added the CGI module, set permissions on the CGI-BIN folder, tried adding and and removing .exe from Mime types as application/octet-stream but can't get it to run the binary file.
I'm not sure what I need to do to make it execute (any) EXE file in the cgi-bin folder.
The fix was to apply the settings as demonstrated here by IBM.
Their Watson Explorer Engine also uses EXE's for it's CGI back end.
IIS 7.0 and higher on Windows 2008 and later systems:
Open IIS Manager:
For Windows 2008 systems: Select Control Panel > Administrative Tools > Internet Information Services (IIS) Manager.
For Windows 2012 systems: From the desktop, hover your cursor in the upper- or lower- right corner of the screen to show the charms. Click the Start charm, and then click the Internet Information Services (IIS) Manager tile.
In the Connections pane, expand the entry for your computer system, expand Sites, and select the default site, which is the site in which the Watson Explorer Engine virtual directory (vivisimo) is created.
Double-click the Handler Mappings feature.
If the state of CGI-exe is Enabled, no additional configuration is necessary. Proceed to Completing the Installation Process (All Platforms).
If the state of CGI-exe is Disabled, select it and click Edit Feature Permissions from the Actions pane. The Edit Feature Permissions window displays.
Select Execute and click OK to enable applications with the .exe extension to execute in response to CGI requests. If Execute is disabled, select Script > Execute, and then click OK.
Related
I am unable to load a csproj in VS2015. I get the Creation of the virtual directory http://localhost:<Port_Number>/ failed with the error: Unable to access the IIS metabase. You do not have sufficient privilege to access IIS web sites on your machine. error. I tried the following:
Uninstalled and reinstalled IIS
Gave access to %systemroot%\system32\inetsrv\config & %systemroot%\system32\inetsrv\config\Export folders
Changed <UseIIS>True</UseIIS> to <UseIIS>False</UseIIS>
Rebooted the system
None of the above worked. Could you advise how to fix this problem please?
You can solve this problem in two ways:
Launch Visual Studio with Administrator priviledges.
Permanently grant the IIS Metabase folder permissions to the current user.
You can press Win + E to open a Windows Explorer instance, then write the following line on the topmost address bar depending on the OS you’re using, As soon as you hit the Enter key the following popup will appear, asking you if you want to permanently grant access to that folder to the current user, click on the Continue button, then try to open up the \Export\ subfolder with a couple mouse clicks and repeat the same process. You’re done: from now on, you’ll be able to launch Visual Studio with default priviledges and your IIS instance will work without hassles.
More information about setting you can refer to this link: setting
I had this problem when trying to load a visual studio 2015 solution. The solution would load but website project would remain unloaded and the output window would show that error message.
Click the unloaded website project in the solution explorer
Go to the properties section dock-window, there is a property called "File Path"
If it is set to an URL, change it to the full physical path to the website.
Reload the project.
I have a clickonce application which works fine on windows 7.
When it's being installed on a windows 10 machine, it seems that the specific file for our application cannot be properly associated to the clickonce application.
If I click right on the file, and choose "open with", I can see in the list "ClickOnce Application Deployment Support Library". But if I choose this option, I get a message saying "this application cannot be executed on your PC". If I decide to choose directly the .exe file of the clickonce application (C:\Users\xxx\AppData\Local\Apps...), it will not work properly (version & update detection).
I am able to install my application and I am able to run it properly from the start menu. The only thing not working is the file association. I have tried to uninstall, and reinstall, but it doesn't change anything.
Edit :
I have installed the application on another windows 10 machine, and everything works fine (including the file assocation "automatically when installed & when specifiying it manually"). So I think the problem is not "generic" for all windows 10 machines.
I was able to reproduce montueron's issue. After turning on logging (https://msdn.microsoft.com/en-us/library/dd996997.aspx) and setting the logging location (https://msdn.microsoft.com/en-us/library/ms404265.aspx), I was able to determine that the file association was being skipped: File association for ".tiff" skipped, since another application is using it.
Here is what I did to solve my problem on Windows 10. My goal is to associate my ClickOnce program, "Tif2PDF", with .TIF and .TIFF image files.
Create a unique file association in the ClickOnce Publish settings in Visual Studio 2017. I am not using .TIF at this time, we just want to create the appropriate registry entry under HKCU\Software\Classes\Tif2PDF which will get removed in the un-install process.
Properties->Publish->Options->File Associations.
extension=.tif2pdf
description=Tif2PDF
progID=Tif2PDF
icon=Resources\Tif2PDF.ico
In the Tif2PDF program startup process, we need to add registry settings when it is installed - only run when it is updated:
if ( System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed
&& ApplicationDeployment.CurrentDeployment.IsFirstRun )
Computer\HKEY_CURRENT_USER\Software\GuardTech\PDFTool\Capabilities\FileAssociations
.tif="Tif2PDF"
.tiff="Tif2PDF"
These two entries tell windows to use the HKCU\Software\Classes\Tif2PDF entry for TIF and TIFF file types.
Tell Windows this is a registered application. This value points to the key created in step 2.
Computer\HKEY_CURRENT_USER\Software\RegisteredApplications
Tif2PDF="Software\Tif2PDF\Capabilities"
At this point, you should see an option in Windows Explorer under "open with" called "ClickOnce Application Deployment Support Library". It will work at this point, but let's add a label and icon.
Create key and values below.
string iconSourcePath == Path.Combine(System.Windows.Forms.Application.StartupPath, #"Resources\Tif2PDF.ico");
Computer\HKEY_CURRENT_USER\Software\Classes\Tif2PDF\Application
ApplicationIcon=iconSourcePath
ApplicationName="Tif2PDF"
You program will need to handle command line arguments a little differently
//Get the normal command lines arguments in case the EXE is called directly
List<string> argList = new List<string>(Environment.GetCommandLineArgs());
argList.RemoveAt(0); //Remove the application.EXE entry
// this is how arguments are passed from windows explorer to clickonce installed apps when files are associated in explorer
if (AppDomain.CurrentDomain.SetupInformation.ActivationArguments?.ActivationData != null )
{
argList.AddRange( AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData);
}
We should try to cleanup these registry settings when we un-install the program by following thedracle's post Custom action on uninstall (clickonce) - in .NET
I just created a test application as Administrator (Windows Forms Application) using Visual Studio 2015 (< 5 minutes)
1) Under Properties/Publish/Options/File Associations added an entry:
Extension: .abcd
Description: test
ProgID: 2
Icon: An icon file
2) Under Properties/Publish I pressed Publish Now and ran Setup
3) Created a text file, renamed it to test.abcd
It is working as expected under Windows 10, so you could create a test application / verify that it's working and see what the differences are compared to your existing application.. 32/64 bit, framework, signing etc.
I'm getting this error in the event log (EventViewer):
The Module DLL C:\Windows\System32\inetsrv\iis_ssi.dll failed to load. The data is the error.
OS is Windows2012 Server. How to fix it?
You need to add SSI in Server Manger. Follow these steps:
Add Roles and Features
In Server Roles, expand Web Server (IIS)
Expand Application Development
Select Server Side Includes
For Windows 2012r2 Operating systems, to be more precise following this step:
Open Server Manager Dashboard
Click on Add Roles and Features
Expand Web Server IIS (if not already selected)
Expand Web Server
Expand Application Development and ensure that all unchecked boxes are selected.
Click Next on the select feature windows to advance
In the Confirm installation selection select specify an alternate source path for the installation CD such as F:\sources\sxs to complete the installation.
Using IIS 7.5 on Windows Server 2008 R2
I need to change the default location for ALL SMTP directories (default locations shown below):
C:\inetpub\mailroot\Badmail
C:\inetpub\mailroot\Drop
C:\inetpub\mailroot\Pickup
C:\inetpub\mailroot\Queue
to the following:
D:\smtp\badmail
D:\smtp\drop
D:\smtp\pickup
D:\smtp\queue
The ONLY directory which is configurable via Start -> Administrative Tools -> Internet Information Services IIS (6.0) Manager is the "Badmail" directory -- a new directory can be entered directly using the IIS (6.0) Manager.
No other option is available for the other 3 directories.
Is there any way to change these directories WITHOUT:
a) Having to install adsutil.vbs?
Is it possible to change these via Powershell?
Did I miss something or some other utility that can do this?
Any help/advice would be appreciated.
Thanks in advance
I going to try to answer my own question... Can anyone (Microsoft) verify if this is correct before I try this little plan?
Start -> Administrative Tools -> Internet Information Services IIS (6.0) Manager
Right-click on sever name and select "Properties"
Check box labeled "Enable Direct Metabase Edit" -> Click OK
Stop the SMTP site.
Using NotePad, open the MetBase file located at C:\Windows\System32\inetsrv\MetaBase.xml
Update the locations for the "Badmail", "Drop", "Pickup" and "Queue" directories. Save file.
Start the SMTP site.
From this point forward, the new directories should be used -- correct?
I didn't find that the accepted answer worked for me in IIS 8.5 Windows Server 2012 R2, but I did find a solution that worked. It requires using the adsutil.vbs that gets installed if you add the feature under the add roles or features wizard - features - management tools - iis6 management compatibility - iis6 scripting tools:
ref. https://www.itnota.com/moving-default-smtp-folders-to-different-drive-windows-server/
Launch Command Prompt (Admin) and run these commands:
net stop smtpsvc
set util=C:\inetpub\AdminScripts\adsutil.vbs
set dst=D:\smtp\
robocopy c:\inetpub\mailroot %dst% /e /copyall /dcopy:T /move
cscript.exe %util% set smtpsvc/1/badmaildirectory %dst%Badmail
cscript.exe %util% set smtpsvc/1/dropdirectory %dst%Drop
cscript.exe %util% set smtpsvc/1/pickupdirectory %dst%Pickup
cscript.exe %util% set smtpsvc/1/queuedirectory %dst%Queue
net start smtpsvc
This only moves folders and sets paths for the first SMTP virtual server. For others, change "smtpsvc/1/" to "smtpsvc/2/", and possibly comment out the robocopy depending on how your paths were configured for the other smtp virtual servers.
So I've backed myself into a corner - I wanted an application or command to run when a user logged in over RDP to a server. As per a best-practice suggestion on a Microsoft site, I set up this program to run under group policy rules and now I have a dilemma:
I log into my server via RDP, the default program launches and then immediately logs me out without a chance for me to do anything.
How can I get into the box again to change this setting? Server is Windows 2008 r2 with terminal services installed on a remote IP.
Could you just remove\edit the GPO, wait a bit, and then reboot the server? You could still send it the "shutdown /m \computername". You could also use psexec to remotely run "gpupdate /force" before rebooting.
If you set that up as local group policy, then you can try opening mmc, choosing the Group Policy editor, and pointing it to that machine to edit the policies. In more detail:
Start --> Run --> mmc
File --> Add/Remove Snap-in
Under the Standalone tab, click Add...
Choose Group Policy Object Editor
In the following wizard, click the Browse button
Click the "Computers" tab, select the Another computer radial button, and type the name or Browse to the remote computer
Click OK, then Finish, then Close, and finally OK
Also you could maybe edit/add a logon script that runs "shutdown -a" to abort logoff/shutdowns, but that may not work due to timing.
You didn't mention if this was Domain, or local, but those options should take care of either.