Yes, that’s correct, I said Windows XP!
I have a very old label program I wrote many years back that pulls nameplate data from jobs so production can print nametags fast and accurately. The program has been running quietly and efficiently on an old Windows XP machine ever since.
Recently, I decided to refresh the program and get it running on new hardware. To my surprise, I have run into a little mystery. My program is simple. It has a table that someone can load one or many rows of nameplate data, basically one row for each nametag to be printed. When the operator hits the print key, using StreamWriter, I write the first row of text found in the table into a network shared Bartender scan folder, then immediately close the file. I then loop until the file is consumed by Bartender. Then rinse and repeat for the remaining rows.
// Wait until file no longer exists (is consumed by commander process)
do
{
} while (File.Exists(printpath + filename[type]));
// Create the file.
using (StreamWriter file = new StreamWriter(printpath + filename[type]))
{
file.WriteLine("\"" + serialno + "\"," + "\"" + modelno + "\"," + "\"" + oil + "\",");
file.Close();
}
This works without any delay on the XP client.
With a Win7, 10 or 11 client, running the exact same code will take several seconds between files being consumed and corresponding label gets printed. To prove to myself it was the OS, I used a Windows 11 machine and ran each OS as a virtual machine from that machine running the very same label executable. XP was fast, Win 7, 10 were slow.
The craziest thing, if I open File Explorer to the network scan folder, the process magically runs fast again and will continue to do so as long as File Explorer is open. If I close File Explorer, it will go back to the long delay between files being consumed.
Curious if anyone has any clue as to what might be going on.
Tim