A personal repository of technical notes. - CSC

Server-Side Include "Failed to map the path"

Problem
In a VS2005 web site solution, the following server-side include:
<!-- #include virtual="/MyIncludeFile.inc" -->

throws the following error:
Failed to map the path '/MyIncludeFile.inc'.

Web site must be set up in solution as a "Local IIS" or with a Location of "HTTP" rather than "File System".

See quote from "Using IIS with VS 2005 and the new Web Project system - ScottGu's Blog":
The file-system tab option is great if you are working on a self-contained web project that requires no knowledge of the directory or URL structure of content outside its structure.

However, if you are using multiple nested IIS applications or special IIS virtual directory rules on your web server to coordinate multiple applications, then you should avoid opening up these projects using the file-system web option – and instead open them using the “Local IIS” or “Remote Site” tab options. The reason for this is because these nesting and relationship rules are stored in the IIS metabase, and for your application to properly run you will want/need these IIS bindings and semantics to be handled both at runtime and inside VS 2005.

Solution
See How to Convert "File System" web site to "HTTP" web site in VS2005
http://csc-technicalnotes.blogspot.com/2009/02/how-to-convert-file-system-web-site-to.html

References
Local IIS Web Sites
http://msdn.microsoft.com/en-us/library/ckk1e6z4(VS.80).aspx

Server-Side Include Directive Syntax
http://msdn.microsoft.com/en-us/library/3207d0e3(VS.80).aspx

Using IIS with VS 2005 and the new Web Project system - ScottGu's Blog
http://weblogs.asp.net/scottgu/archive/2005/08/23/423409.aspx

DTE.ActiveDocument.Selection Missing Inellisense in Macro

Problem
Can not access properties of Selection object through intellisense in VS macro using Visual Studio Automation and Extensibility.

Solution
To use the Selection property of a text file such as program source code, it must first be cast to a TextSelection:

VB.NET
Dim selection As TextSelection = CType(DTE.ActiveDocument.Selection, TextSelection)

C#.NET
TextSelection selection = (TextSelection)DTE.ActiveDocument.Selection;

References
Document.Selection Property (EnvDTE)
http://msdn.microsoft.com/en-us/library/envdte.document.selection(VS.80).aspx

vwd.webinfo Adds Itself to Web Site

Problem
File vwd.webinfo containing StartupServices with Service ID of {967B4E0D-AD0C-4609-AB67-0FA40C0206D8} keeps adding itself to ASP.NET 2.0 web site.

This was related to a past reference to Crystal Reports.

If you delete this within Visual Studio 2005, it is regenerated after closing solution.

Solution
1) Close Visual Studio
2) Open Windows Explorer
3) Delete vwd.webinfo

References
vwd.webinfo - bytes
http://bytes.com/groups/net-asp/672420-vwd-webinfo

Windows XP CHM Shows Page Not Found

Problem
Compiled Help Module (CHM) shows "Page Not Found" in WinXP.

Solution
Right-click/Properties/Unblock

References
You cannot open HTML Help files from Internet Explorer after you install security update 896358 or Windows Server 2003 Service Pack 1
http://support.microsoft.com/kb/902225/

Has error -- Unable to add ... to the Web. ... Access is denied.

Problem
While using Visual Studio 2005 Copy Web Site function, received this type of error on some files:
Has error -- Unable to add 'MyFolder/MyFile.aspx' to the Web. Unable to add file 'MyFolder\MyFile.aspx'. Access is denied.

Solution
Found that files had been manually copied by another developer and had "Read Only" attribute set. Removed "Ready Only" and it worked.

DataFormatString Not Working

Problem
GridView BoundField DataFormatString not working.

Solution
Specify HtmlEncode="false".

<asp:boundfield datafield="MyDataColumn" headertext="Col Hdr" DataFormatString="{0:p}" HtmlEncode="false"/>

See Microsoft note:
When the HtmlEncode property is true, the value of the field is HTML encoded to its string representation before the formatting string is applied. For some objects, such as dates, you might want to control how the object is displayed with a formatting string. In those cases, you must set the HtmlEncode property to false.
References
BoundField.DataFormatString Property (System.Web.UI.WebControls)
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.boundfield.dataformatstring(VS.80).aspx

BoundField.HtmlEncode Property (System.Web.UI.WebControls)
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.boundfield.htmlencode(VS.80).aspx

HTML PRE Tag

<pre></pre>

Preformatted text: The PRE element leaves white space intact, etc.

References
Paragraphs, Lines, and Phrases
http://www.w3.org/TR/REC-html40/struct/text.html#h-9.3.4

XPath Examples

<a>
<b>
<c att='CAttVal'>CVal</c>
</b>
</a>

"a/b/c" = "cVal"
"a/b/c/@att" = "CAttVal"

<a>
<b>
<c att='CAttVal01'>CVal01</c>
<c att='CAttVal02'>CVal02</c>
<c att='CAttVal03'>CVal03</c>
</b>
</a>

"a/b/c[@att='CAttVal02']" = "CVal02"

References
XPath Reference
http://msdn.microsoft.com/en-us/library/ms256115(VS.80).aspx

XPath Examples
http://msdn.microsoft.com/en-us/library/ms256086(VS.80).aspx

Change Saved Network Password

How to change stored network passwords

Windows 7
Connected to a network domain:
Control Panel/User Accounts/Manage Windows Credentials

Not connected to a network domain:
Control Panel/User Accounts and Family Safety/User Accounts

See "Manage Stored Passwords, Certificates, and Other Credentials." Microsoft Windows. Web. 19 Oct. 2011.
<http://windows.microsoft.com/en-US/windows7/Manage-stored-passwords-certificates-and-other-credentials>.

Windows Server 2003
Start/Control Panel/Stored User Names and Passwords

WinXP
Start/Control Panel/User Accounts

If joined to a domain:

Advanced Tab/Manage Passwords

If not joined to a domain:

Select account name/Manage my network passwords

References
How to manage stored user names and passwords on a computer in a domain in Windows XP
http://support.microsoft.com/kb/306992/EN-US/

How To Manage Stored User Names and Passwords on a Computer That Is Not in a Domain in Windows XP
http://support.microsoft.com/kb/306541

Updates
2011-10-19 Added "Windows 7"

Expose Custom Control Sub-Property to Intellisense

// Exposes subproperties to intellisense

using System.ComponentModel;

[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public Literal MyLiteral
{
get { return myLiteral; }
set { myLiteral = value; }
}

// So that the following will show up in intellisense of control in front end:
MyLiteral-Text=""

SQL Conditional Sorting with Dynamic ORDER BY

Dynamic SQL Sorting with ORDER BY
  

DECLARE @sortByColumn varchar(100)

SELECT @sortByColumn = 'MyColumn05'-- 'MyColumn01'-- 'X'--

-- Dynamic Sorting Column in SELECT

SELECT

MyColumn01

,MyColumn02

,(MyColumn03 * MyColumn04)

,MyColumn05

,CASE @sortByColumn

WHEN 'MyColumn01' THEN MyColumn01

WHEN 'MyColumn02' THEN MyColumn02

WHEN 'MyColumn05' THEN STR(MyColumn05,19,16)

ELSE MyColumn01

END AS SorterColumn

FROM MyTableA

ORDER BY SorterColumn

-- Dynamic Sorting Column in ORDER BY

SELECT

MyColumn01

,MyColumn02

,(MyColumn03 * MyColumn04) AS NewColumn -- Calculation duplicated below in ORDER BY

,MyColumn05

FROM MyTableA

ORDER BY

CASE @sortByColumn

WHEN 'MyColumn01' THEN MyColumn01

WHEN 'MyColumn02' THEN MyColumn02

WHEN 'NewColumn' THEN STR(MyColumn03 * MyColumn04) -- Calculation duplicated above in SELECT

WHEN 'MyColumn05' THEN STR(MyColumn05,19,16)

ELSE MyColumn01

END

SELECT

MyColumn01

,MyColumn02

FROM MyTableA

ORDER BY

CASE

WHEN MyColumn01 > 0 THEN 0

ELSE 1

END

,MyColumn02

--------------------------------------------------

DECLARE @sortDesc bit

SELECT @sortDesc = 1-- 0--

-- Dynamic DESCENDING / ASCENDING

SELECT AsOfDate,MyColumn01,MyColumn05

FROM MyTableA

WHERE AsOfDate = '7-31-2007'

ORDER BY

CASE WHEN @sortDesc = 0 THEN MyColumn01 END ASC,

CASE WHEN @sortDesc = 1 THEN MyColumn01 END DESC

-- Dynamic DESCENDING / ASCENDING with Dynamic Sorting Column in ORDER BY

SELECT

MyColumn01

,MyColumn02

,(MyColumn03 * MyColumn04) AS NewColumn -- Calculation duplicated below in ORDER BY

,MyColumn05

FROM MyTableA

LEFT OUTER JOIN MyTableB

ON FM_TICKER = MyColumn01

WHERE AsOfDate = '7-31-2007'

ORDER BY

-- Ascending Sorts

CASE WHEN @sortDesc = 0 AND @sortByColumn = 'MyColumn01' THEN MyColumn01 END ASC,

CASE WHEN @sortDesc = 0 AND @sortByColumn = 'MyColumn02' THEN MyColumn02 END ASC,

CASE WHEN @sortDesc = 0 AND @sortByColumn = 'NewColumn' THEN STR(MyColumn03 * MyColumn04) END ASC, -- Calculation duplicated above in SELECT

CASE WHEN @sortDesc = 0 AND @sortByColumn = 'MyColumn05' THEN STR(MyColumn05,19,16) END ASC,

-- Descending Sorts

CASE WHEN @sortDesc = 1 AND @sortByColumn = 'MyColumn01' THEN MyColumn01 END DESC,

CASE WHEN @sortDesc = 1 AND @sortByColumn = 'MyColumn02' THEN MyColumn02 END DESC,

CASE WHEN @sortDesc = 1 AND @sortByColumn = 'NewColumn' THEN STR(MyColumn03 * MyColumn04) END DESC, -- Calculation duplicated above in SELECT

CASE WHEN @sortDesc = 1 AND @sortByColumn = 'MyColumn05' THEN STR(MyColumn05,19,16) END DESC

-- WARNING: Dynamic DESCENDING / ASCENDING **DOES NOT WORK** with Dynamic Sorting Column in SELECT

SELECT AsOfDate,MyColumn01,MyColumn05

,CASE @sortByColumn

WHEN 'MyColumn01' THEN MyColumn01

WHEN 'MyColumn05' THEN STR(MyColumn05,19,16)

END AS SorterColumn

FROM MyTableA

WHERE AsOfDate = '7-31-2007'

ORDER BY

CASE WHEN @sortDesc = 0 THEN SorterColumn END ASC,

CASE WHEN @sortDesc = 1 THEN SorterColumn END DESC

Visual Studio Remove Recent Projects MRU

Problem
Need to remove obsolete items from most recently used (MRU) Project items in Visual Studio.

Solution
To clear mru project list in Visual Studio
  1. Exit out of Visual Studio.
  2. Find entries located in registry location:
    VS2005: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\ProjectMRUList
    VS2008: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\ProjectMRUList
  3. Change unwanted entries to "DELETEME".
  4. Open Visual Studio
  5. Click on entries labeled "DELETEME" under "Recent Projects".
  6. Select "Yes" when asked to remove entry.
References
None

Updates
2011-01-21 Added VS2008 location.
2010-09-08 Changed removal procedure.

SSMS Connect to Server Server Name List

Problem
How do you remove the server name entries from the Connect to Server dialog box in Microsoft SQL Server Management Studio?

Solution for SSMS 2005
Delete the entire MRU list while SSMS is not running. When it starts up again, a new empty list will be created. As of this posting, I know of no way to remove individual items. MRU location:
%APPDATA%\Microsoft\Microsoft SQL Server\90\Tools\Shell\mru.dat

Solution for SSMS 2008
Delete the entire settings file while SSMS is not running. WARNING: This file contains other settings.
%APPDATA%\Microsoft\Microsoft SQL Server\100\Tools\Shell\SqlStudio.bin

References
About The Connect to Server Dialog - MSDN Forums
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=146430&SiteID=1

SQL Server Forums - SSMS drop down
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=72477

How to get rid of unused servers in SSMS? - TechNet Forums
http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=532146&SiteID=17

SSMS Default Database

To set default database for Microsoft SQL Server Management Studio:

1) On "Connect to Server" dialog box, click button "Options >>"
2) Under "Connection Properties" tab, select the name of the database for the connection.

.NET 2.0 Type.GetType (String) Returns NULL

Problem
Type.GetType (String, true) throws the following error:
Could not load type 'MyType' from assembly 'MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

Solution
String needs to be the assembly-qualified name of the Type:
MyType.GetType().AssemblyQualifiedName


References
Haibo Luo's weblog : Type.GetType(string typeName) returns null !?
http://blogs.msdn.com/haibo_luo/archive/2005/08/21/454213.aspx

Type.GetType Method (String) (System)
http://msdn.microsoft.com/en-us/library/w3f99sx1(VS.80).aspx

CSS Indentation

<div style="padding-left:30px;">This is indented.</div>
<span style="padding-left:30px;">This is indented.</span>
<div class="Indent"></div>
<span class="Indent"></span>
<span style="margin-left:3em; text-indent:-3em;">A hanging indent.</span>
<span class="hang"></span>
<b>Updates</b>
<div class="hang">YYYY-MM-DD Added "Xxx"</div>

<div class="EdNote">Note</div>

JavaScript Enum Emulator

var pageState = {
Normal : 0 ,Autoloading : 1 ,AutoloadStopping : 2
} var myPageStage = pageState.Normal; alert(myPageStage);
References
How to do enumerations (enum) in javascript | Javascript Kata
http://www.javascriptkata.com/2007/03/22/how-to-do-enumerations-enum-in-javascript/

How to use anonymous objects | Javascript Kata
http://www.javascriptkata.com/2007/03/22/how-to-use-anonymous-objects/

Custom Command Prompt Prompt

How to make a custom 2 line command prompt for all command prompts in Windows

Example

C:\WINDOWS\system32
> _


Steps

  1. Right-click My Computer
  2. Properties
  3. Advanced system settings
  4. Environment Variables button
  5. New button under User variables for My User Name
  6. Variable name: PROMPT
  7. Variable value: $P$_$G$S
  8. OK
Notes
Where $P$_$G$S is
$p = Current drive and path
$_ = ENTER-LINEFEED
$g = > (greater-than sign)
$s = space
Note: Tested in Windows 7, Windows Server 2008, Windows XP.

References
Prompt
http://technet.microsoft.com/en-us/library/bb490977.aspx

Determine .NET Version

Updated 2011-10-17
1) In the Registry Editor, locate the Registry Key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\
2) Compare settings to table on Microsoft site:
Old Method
1) View properties version tab of mscorlib.dll in .NET framework folder.
Example:
C:\WINNT\Microsoft.NET\Framework\v1.1.4322\mscorlib.dll
File version: 1.1.4322.2032

2) Match up to Microsoft's list:

The released versions of the .NET Framework have the following version information.

Collapse this tableExpand this table
.NET Framework versionRevisionVersion
3.5Original release3.5.21022.8
3.5Service Pack 13.5.30729.1
3.0Original release3.0.4506.30
3.0Service Pack 13.0.4506.648
3.0Service Pack 23.0.4506.2152
2.0Original release2.0.50727.42
2.0Service Pack 12.0.50727.1433
2.0Service Pack 22.0.50727.3053
1.1Original release1.1.4322.573
1.1Service Pack 11.1.4322.2032
1.1Service Pack 1 (Windows Server 2003 32-bit version*)1.1.4322.2300
1.0Original release1.0.3705.0
1.0Service Pack 11.0.3705.209
1.0Service Pack 21.0.3705.288
1.0Service Pack 31.0.3705.6018
*The Microsoft .NET Framework 1.1 is included with the 32-bit version of Windows Server 2003.
(Microsoft Help and Support)

See Microsoft's web site below in References for latest list.

References
"How to determine which versions of the .NET Framework are installed and whether service packs have been applied." Microsoft Help and Support. 30 Jan. 2009 http://support.microsoft.com/kb/318785.

DLL Help Database
http://support.microsoft.com/dllhelp/?dlltype=file&l=55α=Mscorlib.dll&S=1&x=10&y=13

DBNull Handling and Conversions

Invalid Conversions of DBNull.Value

string myStr = (string)dbRecord["DBCOLUMN"]; // Unable to cast object of type 'System.DBNull' to type 'System.String'.
int myInt = Convert.ToInt32(dbRecord["DBCOLUMN"]); // Object cannot be cast from DBNull to other types.
bool myBln = (bool)dbRecord["DBCOLUMN"]; // Specified cast is not valid.
bool myBln = Convert.ToBoolean(dbRecord["DBCOLUMN"]); // Object cannot be cast from DBNull to other types.


Valid Conversions of DBNull.Value

string myStr = dbRecord["DBCOLUMN"] as string; // Converts to null
string myStr = Convert.ToString(dbRecord["DBCOLUMN"]); // Converts to empty string

int myInt = (dbRecord["DBCOLUMN"] == DBNull.Value) ? 0 : (int)dbRecord["DBCOLUMN"]; // Integer to 0 if DBNull
int myInt = (dbRecord["DBCOLUMN"] == DBNull.Value) ? (short)0 : (short)dbRecord["DBCOLUMN"]; // Cast SQL smallint to C# int
bool myBln = (dbRecord["DBCOLUMN"] == DBNull.Value) ? false : (bool)dbRecord["DBCOLUMN"]; // Boolean to false if DBNull
myBln = (dbRecord["DBCOLUMN"] == DBNull.Value) ? false : (dbRecord["DBCOLUMN"].ToString().ToUpper() == "Y"); // String to Boolean with DBNull check
DateTime myDateTime = (dataReader["DBCOLUMN"] == DBNull.Value) ? DateTime.MinValue : Convert.ToDateTime(dataReader["DBCOLUMN"]); // DateTime to DateTime

References
?: Operator (C# Reference)
http://msdn.microsoft.com/en-us/library/ty67wk28.aspx

Convert Class (System)
http://msdn.microsoft.com/en-us/library/system.convert(VS.80).aspx

as (C#)
http://msdn.microsoft.com/en-us/library/cscsdfbt(VS.80).aspx

Firefox IFrame Height

<style type="text/css">
HTML,BODY
{
height: 100%;
}
#MainFrame
{
width: 75%;
height: 90%;
}
</style>
<iframe id="MainFrame" src="about:blank"></iframe>

Can't Delete Firefox Bookmark Tags

Workaround to delete tag that will not go away:

1) Remove tag from all known bookmarks
2) Type tag in location bar (for me, an old bookmark appeared with tag applied)
3) Select location
4) Bookmark location by clicking on the star
5) Click on star again and select "Remove Bookmark" button.

CSS Display vs Visibility

display: none;
display: block;
display: inline;


VS

visibility: visible;
visibility: hidden;


Unlike display:none;, with visibility: hidden; objects that are not visible still reserve the same physical space in the content layout as they would if they were visible.

References
display Property (A, ABBR, ACRONYM, ...)
http://msdn.microsoft.com/en-us/library/ms530751(VS.85).aspx

visibility Property (A, ADDRESS, APPLET, ...)
http://msdn.microsoft.com/en-us/library/ms531180(VS.85).aspx

C# Casting

() Operator (C# Reference)
http://msdn.microsoft.com/en-us/library/0z4503sa.aspx

double x = 1234.7;
int a;
a = (int)x; // Cast double to int


Remarks: A cast explicitly invokes the conversion operator from one type to another; the cast fails if no such conversion operator is defined.


as (C# Reference)
http://msdn.microsoft.com/en-us/library/cscsdfbt.aspx

string s = someObject as string;
if (s != null)
{
// someObject is a string.
}


The as operator is similar to a cast operation; however, if the conversion is not possible, as returns null instead of raising an exception. More formally, an expression of the form,

expression as type


Convert.ToInt32 Method (System)
http://msdn.microsoft.com/en-us/library/system.convert.toint32(VS.80).aspx

Return Value: A 32-bit signed integer equivalent to the value of value, or zero if value is a null reference

Terminal Services Remote Desktop Command Line

References
Terminal Services commands (WinXP Help and Support Center)
mk:@MSITStore:C:\WINDOWS\Help\ntcmds.chm::/ts_cmds.htm

Terminal Services query commands: Terminal Services
http://technet.microsoft.com/en-us/library/cc755411.aspx

Examples
C:\>query user /server:123.123.123.123
USERNAME SESSIONNAME ID STATE IDLE TIME LOGON TIME
user1 0 Disc 23 7/23/2008 3:11 PM
user2 rdp-tcp#107 1 Active 8 7/22/2008 10:23 AM
user1 rdp-tcp#102 3 Active 23 7/24/2008 10:20 AM

C:\>query session /server:123.123.123.123
SESSIONNAME USERNAME ID STATE TYPE DEVICE
user1 0 Disc rdpwd
rdp-tcp 65536 Listen rdpwd
console 4 Conn wdcon
rdp-tcp#107 user2 1 Active rdpwd
rdp-tcp#102 user1 3 Active rdpwd

C:\>reset session 0 /v /server:123.123.123.123
Resetting session ID 0
Session ID 0 has been reset

mstsc.exe /console
Connects to the console session of the specified Windows 2000 Server.


DOS BAT file utility source code for querying session:

@echo off
echo Server=%1
echo.
query session /server:%1
echo.
query user /server:%1
echo.
echo Reset syntax:
echo reset session # /v /server:%1
echo.
pause

Create shortcut to call bat file and pass IP address in target. Example:
"C:\MyUtilities\query session.bat" "123.1.2.3"

shell:folder Shortcuts

From Start/Run or from Windows Explorer address bar in WinXP:
shell:sendto
shell:desktop


Some registry locations of shell folders:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders

References
Note: I could not find this documented on any Microsoft web site.

svchost.exe

References
What is svchost.exe And Why Is It Running? :: the How-To Geek
http://www.howtogeek.com/howto/windows-vista/what-is-svchostexe-and-why-is-it-running/

DTS Unencrypt DTSRUN Hex Parameter

Use parameters /!X /!C at end of DTSRun to copy unencrypted command to clipboard.

Example:
DTSRun /~Z0x223AD03... /!X /!C

/!X
Blocks execution of the selected DTS package. Use this command parameter when you want to create an encrypted command line without executing the DTS package.

/!C
Copies the command used to execute the DTS package to the Microsoft Windows® clipboard.

References
dtsrun Utility
http://msdn.microsoft.com/en-us/library/aa224467.aspx

Storage File contains multiple Packages

Job running DTS package converted from SQL 2000 to SQL 2005 failed with the following error:

DTSRun: Loading... Error: -2147220438 (8004042A); Provider Error: 0 (0)
Error string: The specified Storage File contains multiple Packages; Loading requires a Name or Guid.
Error source: Microsoft Data Transformation Services (DTS) Package
Help file: sqldts80.hlp
Help context: 713

Solution that worked for me was to open the DTS package and then save it. (Click Package/Save).

Location bar search

Excerpted from:
http://support.mozilla.com/en-US/kb/Location+bar+search

If you enter text into the Location bar that is not a valid Internet address (URL), Firefox will try to direct you to the location you intended.

Internet Keyword search

  1. about:config
  2. keyword.enabled
    • false disables Internet Keyword searches.
    • true enables Internet Keyword searches.
Domain Guessing
  1. about:config
  2. browser.fixup.alternate.enabled
    • false disables Domain Guessing.
    • true enables Domain Guessing.

References
Customising the Firefox 3 Location Bar. • mozillaZine Forums
http://forums.mozillazine.org/viewtopic.php?f=38&t=685365

Zork 1 and Windows XP

Dusted off Zork 1 from Infocom. Text didn't work right in WinXP after double clicking on ZORK1.BAT. The cursor just stayed at the top and the text just kept overlaying itself.



Tried setting compatibility mode on ZORK1.BAT to Win95. Didn't make a difference. Finally got it to work by opening a command prompt (cmd.exe) and opening ZORK1.BAT from there. Then the window looked right.



For convenience, I then created a shortcut to run it.

Create Shortcut
  1. In Windows Explorer, browse to the folder that contains ZORK1.BAT
  2. Click File/New/Shortcut
  3. Enter "cmd.exe"
  4. Click Next
  5. Give it a name (Ex: "Run Zork 1")
  6. Click Finish
Modify New Shortcut
  1. Right-click/Properties
  2. Add " /C ZORK1.BAT" to end of target
  3. Put the folder that contains ZORK1.BAT in the "Start in:" box. (Ex: "C:\Games\Infocom\Zork1")
  4. Click OK


For even more convenience, drag the shortcut over to the Start button!

Blog Archive