Tapatalk

Connect UltraEdit to IIS Manager

Connect UltraEdit to IIS Manager

7
NewbieNewbie
7

PostJan 31, 2025#1

Hello

I have set IIS as server to manage a local site with simple static html pages, with the following settings:
Local folder: D:\mysite
Host name: mysite
Bindings: http: *8080
This way, I can see the site in a browser using the address http://mysite:8080/
(I have set IIS to "recognize" the default.html in the root so I don't have to give the full address http://mysite:8080/default.html)

Is there a way to connect UltraEdit to IIS so, I can open a page "D:\mysite\subfolder\mypage.html" from within UEdit  directly in the browser as http://mysite:8080/subfolder/mypage.html?

Thanks

6,824625
Grand MasterGrand Master
6,824625

PostJan 31, 2025#2

I do not understand why IIS is needed at all for a local website consisting only of static HTML files with CSS, JS and image files. It should be possible to just double click in Windows File Explorer on D:\mysite\default.html or D:\mysite\subfolder\mypage.html and HTML file should be displayed in the favorite browser. If that works there can be used in UltraEdit the command Show file in browser or use UltraEdit built-in browser view support with the command Toggle browser view or Toggle live preview (vertical or horizontal). That's how I work with local websites.

However, there can be configured a user tool in the Tool Configuration dialog window with:

Tab Command:

Menu item name: Open in Browser with IIS
Command line: C:\Windows\System32\cmd.exe /D /Q /S /E:ON /V:ON /C "set "URL=%f" & (if defined URL (for /F "tokens=2* delims=\" %G in ("!URL!") do set "URL=http://%G:8080/%H" & set "URL=!URL:\=/!") else set "URL=http://mysite:8080/default.html") & start "" "!URL!"
Working directory: %p
Toolbar bitmap/icon (file path): full file name of an icon file with a nice icon for this user tool suitable for menu/toolbar/ribbon
Use embedded icon in executable (if available): unchecked as cmd.exe does not have one

Tab Options:
Program type: Windows program (the finally started browser, not cmd.exe)
Save active file: checked
Save all files first: checked or unchecked your decision

Tab Output:

Command output: Append to existing
Show DOS box: unchecked
Capture output: unchecked
Clear output before run: unchecked
Replace selected text with: No replace
Handle output as: ANSI

An execution of this user tool results in starting cmd.exe with the directory of active file as current working directory referenced with %p and with the full file name of the active file referenced with %f with a long command line with multiple commands which first assigns the passed file name to an environment variable URL which on being indeed defined is reformatted with command for and to executions of command set to the IIS expected URL. Otherwise on user tool executed without any file active, the environment variable URL is defined with the default URL. Finally is started
the favorite browser associated with the protocol http with the URL as argument. Then cmd.exe closes itself.

7
NewbieNewbie
7

PostJan 31, 2025#3

Well, css and js files are linked in every html document like:

Code: Select all

<script src="/script.js"></script> 
<link href="/css.css" rel="stylesheet">
So, when I open the file from File Explorer I just see the contents but not the styles and the functionality.
A server is needed to render the full code, isn't it?

I'll try your suggestion and see what will be (I'm not very code-familiar person!)

Thanks.

PostFeb 01, 2025#4

Yes, it's perfect!
Thank you for your detailed instructions.