Code snips, and programming examples.

Change Computer Name to Serial

Little Windows VBS script to pull Dell BIOS serial tags into Computer Names. I pulled this from an old backup, since it got removed a long time ago for whatever reason.

strUser = "Administrator"
strPassword = "P@ssw0rd"

Set objNetwork = CreateObject("WScript.Network")
	strComputer = objNetwork.ComputerName

Set objComputer = GetObject("winmgmts:{impersonationLevel=Impersonate}!\\" & _
	strComputer & "\root\cimv2:Win32_ComputerSystem.Name='" & _
		strComputer & "'")

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem",,48)
For Each objItem in colItems
	strMsg = objItem.Caption
	If strMsg = "Microsoft Windows XP Professional" Then

		winmgmt1 = "winmgmts:{impersonationLevel=impersonate}!//."
		'WScript.Echo winmgmt1
			Set SNSet = GetObject( winmgmt1 ).InstancesOf ("Win32_BIOS")
			for each SN in SNSet

				If SN.SerialNumber = strComputer Then
					MsgBox "Computer name already set! Name is: "& strComputer
				End If

				If SN.SerialNumber = "" Then
					MsgBox "Problem with computer naming!"
				End If

				ErrCode = objComputer.Rename(SN.SerialNumber, strPassword, strUser)

				If ErrCode = 0 Then
					MsgBox "Computer renamed successfully to: "& SN.SerialNumber
				End If


	End If
By |January 6th, 2017|Categories: Code|Tags: , |0 Comments

Reddit Posts on Archaic Binary BBS

I have been asked on the BBS how I pulled reddit links into the BBS for callers to see. As you might know, I have been using RMLib to make some simple door utilities with C#.

My latest utility pulls some headlines from reddit, as well as showing recent activity on the board.

Here is the code that does this… I don’t want to release the full program source yet, as it has other stuff I need to finish up. Sorry.
Using this though you should be able to get a C# door running with RMLib.

WebClient w = new WebClient();
            string s = w.DownloadString("");
            string cleanString = "";
            string cleanURL = "";

            foreach (LinkItem i in LinkFinder.Find(s))
                cleanString = Regex.Replace(i.Text.ToString(), @"[^\u0000-\u007F]", string.Empty);
                cleanURL = Regex.Replace(i.Href.ToString(), @"[^\u0000-\u007F]", string.Empty);
                Door.WriteLn(StringUtils.PadRight(cleanString, ' ', 57) + " | ");
                Door.WriteLn(StringUtils.PadRight(cleanURL, ' ', 57) + " | ");
                Door.WriteLn(StringUtils.PadRight(" ", ' ', 57) + " | ");


public struct LinkItem
            public string Href;
            public string Text;

            public override string ToString()
                return Text + Href;

static class LinkFinder
            public static List Find(string file)
                List list = new List();
                int j = 0;

                MatchCollection m1 = Regex.Matches(file, @"(.*?)", RegexOptions.Singleline);

                foreach (Match m in m1)
                    if (j <= 6)
                        string value = m.Groups[1].Value;
                        LinkItem i = new LinkItem();

                        Match m2 = Regex.Match(value, @"href=\""(.*?)\""", RegexOptions.Singleline);
                        if (m2.Success)
                            i.Href = m2.Groups[1].Value;


                        string t = Regex.Replace(value, @"\s*<.*?>\s*", "", RegexOptions.Singleline);
                        i.Text = t;


                j = 0;
                return list;
By |June 17th, 2014|Categories: Code|Tags: , , |4 Comments

32bit File Download BBS Door

I have been looking around for a file transfer door, that is 32bit compatible and can utilize a 32bit file transfer protocol instead of relying on old DSZ 16bit programs to send files over YModem and ZModem.

Without much luck I took the RMLib and developed a very simple door program for 32bit BBSs’ that lets users download files. It’s a very simple interface, using XML as a storage medium for filenames and descriptions. Then passes all the information needed to transfer the file to Synchronets’ SEXYZ.EXE program since it’s able to transfer files using X/Y/ZModem and it’s already 32bit.

Still needs work, and I’m adding and cleaning it up still but you can grab a copy of the source and program if you want to do something similar with your BBS.

By |April 10th, 2014|Categories: Code|Tags: , , , , , , , |1 Comment

Telnet Server Connection

I have been working on getting my multi-node BBS back online using some FOSSIL drivers and telnet instead of dial-up modems.

One large problem is the speed Windows NTVDM (DOS Console) gives to legacy 16-bit applications running inside of it. You can really tell the difference from running a pure DOS 6.22 install with a packet driver and FOSSIL -> Telnet software and running say Windows 2003 server with the software inside a DOS box, especially when drawing full screen ANSI.

So this is what I did, I found the best combination by running two Windows NT 4 Servers (inside ESXi), and then loading TelSrv on each. It’s odd that NT 4 handles DOS virtual machines (NTVDM) better then Windows 2000 and 2003. When the DOS software is setup correctly and tested, the NTVDM rarely used more then 20% spiking and around 3% idle.

Each ESXi virtual machine handles two nodes currently, for a total of four. Now the problem comes up how can I handle connections from the outside, coming into one port (23 Telnet) off the router and then choose which telnet server to redirect it to.

I built this small application in C# that will take in a telnet connection, and then based on the code at the moment, will direct it to a specific server based on some simple rules. Say, first connection and third to server one, and second and fourth to server two.

If you need more information on running it, you can check the source code that is available, as I cannot offer a compiled version. It would be of no use unless you changed the code anyway.

I suppose you could re-route any TCP socket connections using this, I know FTP will not work, as it uses two sockets.

Telnet Concentrator

By |September 10th, 2012|Categories: Code|Tags: , , , , , |0 Comments