WIN32_FIND_DATA and negative file sizes.
July 13, 2010
UPDATE: Thanks to the comment from Bart, I found a problem with my approach. I used the pInvoke.net example in my code and they defined the nFileSizeHigh and nFileSizeLow as integers. This is why there was so much overflow. They should have been defined as unsigned int to allow for a greater range. I am going to leave my solution untouched below because it worked and it is a good learning experience. However if you ever need to use WIN32_FIND_DATA make sure you are using unsigned integers and the the MSDN solution should work fine. Thanks again to Bart.
————————————————————————————————
ORIGINAL POST BEGINS:
I recently had the job of writing an application using the .NET Framework for work that would walk through the folders at a given location and return the total of all the file sizes so we can track changes in certain directories. I quickly found out that the .NET Framework does not allow for folder paths that are beyond 260 characters and you get an exception if you try. Well that is a pain.
Add a printer for all users in Windows
April 3, 2010
So I was trying to figure out a way to add a network printer to a Windows machine so that it shows up for all users regardless of whether or not they have added it. After some searching I found a command that could be run from the command line that would do the trick.
But it was pretty gnarly:
rundll32 printui.dll,PrintUIEntry /ga /n\\serverName\printerName
All options can be seen by using:
rundll32 printui.dll,PrintUIEntry /?
MSN email and Evolution mail client setup.
March 20, 2010
Thanks to this post for this information. I’ve collected it here in one place. These are the sttings required for a new MSN inbox within the Evolution mail client. Setup a new mailbox with these settings.
Recieving Mail Tab:
Server Type: POP (dropdown menu)
Server: POP3.live.com
Username: youremail@msn.com
Security: SSL encryption
Authentication Type: password
the box to remember passord is checked.
Server Type: SMTP (dropdown menu)
Server: smtp.live.com
Server Requires Authentication (box is checked)
Security: Use Secure Connection (TLS)
Authentication Type: Login
Username: youremail@msn.com
box to remember password is checked.
Worked for me. Sending and receiving.
Convert a column number to a column name. Java example.
January 7, 2010
In one of my classes we built a spreadsheet program using java. One of the problems we had to figure out was how to access the columns. In a spreadsheet the columns are referenced by letters: column A, column AAZ, etc. Our underlying data structure consisted of array lists of array lists. Obviously you can’t reference a cell by a letter it has to be a zero based number reference.
Page Up/Page Down doesn’t work correctly in Firefox
February 27, 2009
OK so I think this one is entirely my fault but it was still driving me nuts. Whenever I tried to use the Page Up or Page Down key while viewing a web page in Firefox it would move the page down then almost immediately shoot back to where I was viewing before.
In addition to this using the arrow keys to move up and down was also a iffy prospect. One day when I was low on sleep and using my computer this happened. I had simply been ignoring it for so long. I finally typed this sentence into Google search:
firefox page up page down fuck
Active Directory Users and Computers Error: “the application has requested the runtime to terminate it in an unusual way”
August 27, 2008
UPDATE [6/19/2009]: Below is my original fix for this problem however in the comments section frymaster provided an alternative. I am no longer running Vista 64 so haven’t tested it but another user has confirmed it worked for him.
Try deleting this file:
%userprofile%\appdata\Roaming\Microsoft\MMC\dsa
It will be recreated after you shut down your MMC console.
Thanks to frymaster for the update!
[Original Post]
I installed the newest version of RSAT for Vista Service Pack 1. I am running the 64-bit Version of Vista.
After installing this newest version I got this error when trying to start Active Directory Users and Computers:
Microsoft Visual C++ Runtime Library
“the application has requested the runtime to terminate it in an unusual way”
Get Members of an Active Directory Group Using Powershell
August 11, 2008
HP Director Won’t Start
August 11, 2008
I got a call at the Helpdesk today about a scanner in one of the faculty’s labs. It was an HP 4570 Scanjet. The scanner worked fine it was the software that came with it that was a problem.
Get an Active Directory Property from Powershell
June 27, 2008
In an earlier post I mentioned a useful link for Powershell users. I am happy to say I used the cheat sheet today.
Sometimes you want to grab a property from an Active Directory entry. I wanted to be able to do it from Powershell.
One of the cool things about PowerShell is that you can access the Namespaces in the .net framework. So you can put together a script that can access Active Directory the same way you do it from .net Code using Directory Services.
Here is what I came up with: Read the rest of this entry »
Powershell Cheat Sheet
June 27, 2008
Ever use Powershell? I run into situations every once in a while where it is really useful but I always seem to forget the syntax. I found a link to a really cool cheat sheet that I just tacked onto my wall so I won’t ever be lost again.
Check it here: http://blogs.msdn.com/b/powershell/archive/2007/01/24/powershell-cheat-sheet.aspx