Windows 7 : How to access the advanced boot options on your laptop

If you are a windows pc user for quite some time, accessing the Windows 7 to see the Advanced Boot Options can be a challenge if you are using different laptop brands. Here are the list of shortcut key combinations

Enjoy

Coffee Cup

 

Acer – Alt + F10

Asus – F9

Dell/Alienware – F8

HP – F11

Lenovo – F11

MSI – F3

Samsung – F4

Sony – F10

Toshiba – 0 (not numpad) while turning on, release key when Toshiba logo appears

 

Delphi : How to change the date format on both inside the app and globally

I have encountered an issue the other week of a friend that want the default date be changed to another format inside the app. After digging a few days later i came out with a complete list of local settings you can change while inside the delphi environment. Will be posting the codes here for anyone who has encountered the same issues as i have. Hope this helps somebody out there.

Enjoy

Coffee Cup

CurrencyString, CurrencyFormat, NegCurrFormat, ThousandSeparator,
DecimalSeparator, CurrencyDecimals, DateSeparator, ShortDateFormat,
LongDateFormat, TimeSeparator, TimeAMString, TimePMString,
ShortTimeFormat, LongTimeFormat

//Change COMPUTER date and time
SetLocaleInfo(GetThreadLocale, LOCALE_SSHORTDATE, ‘MM/dd/yyyy’);
SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, 0,
SMTO_ABORTIFHUNG, 1000, PDWord(Nil)^);

//Change formatting from within the APPLICATION
DateSeparator := ‘/’;
ShortDateFormat := ‘MM/dd/yyyy’;

Delphi : Retrieving various locale information

I got this info from a website that showcases all of the identifiers for each pc. Thought of posting it here also in my blog for future references

Question: How can I determine various locale information using delphi?

Answer:
Delphi has a function called GetLocaleInfo which you can use to retrieve information such as the system language, currency symbol, number of decimal digits and so forth.

Here is a function that will return locale information based on the parameter “flag” :

……..
function TForm1.GetLocaleInformation(Flag: Integer): String;
var
pcLCA: Array[0..20] of Char;
begin
if( GetLocaleInfo(LOCALE_SYSTEM_DEFAULT,Flag,pcLCA,19) pcLCA[0] := #0;
end;
Result := pcLCA;
end;
……..

Example of using the function:

……..
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(GetLocaleInformation(LOCALE_SENGLANGUAGE));
end;
……..

“Flag” can take the following values (as seen in Windows.pas):

LOCALE_NOUSEROVERRIDE { do not use user overrides }
LOCALE_USE_CP_ACP { use the system ACP }
LOCALE_ILANGUAGE { language id }
LOCALE_SLANGUAGE { localized name of language }
LOCALE_SENGLANGUAGE { English name of language
LOCALE_SABBREVLANGNAME { abbreviated language name }
LOCALE_SNATIVELANGNAME { native name of language }
LOCALE_ICOUNTRY { country code }
LOCALE_SCOUNTRY { localized name of country }
LOCALE_SENGCOUNTRY { English name of country }
LOCALE_SABBREVCTRYNAME { abbreviated country name }
LOCALE_SNATIVECTRYNAME { native name of country }
LOCALE_IDEFAULTLANGUAGE { default language id }
LOCALE_IDEFAULTCOUNTRY { default country code }
LOCALE_IDEFAULTCODEPAGE { default oem code page }
LOCALE_IDEFAULTANSICODEPAGE { default ansi code page }
LOCALE_IDEFAULTMACCODEPAGE { default mac code page }
LOCALE_SLIST { list item separator }
LOCALE_IMEASURE { 0 = metric, 1 = US }
LOCALE_SDECIMAL { decimal separator }
LOCALE_STHOUSAND { thousand separator }
LOCALE_SGROUPING { digit grouping }
LOCALE_IDIGITS { number of fractional digits }
LOCALE_ILZERO { leading zeros for decimal }
LOCALE_INEGNUMBER { negative number mode }
LOCALE_SNATIVEDIGITS { native ascii 0-9 }
LOCALE_SCURRENCY { local monetary symbol }
LOCALE_SINTLSYMBOL { intl monetary symbol }
LOCALE_SMONDECIMALSEP { monetary decimal separator }
LOCALE_SMONTHOUSANDSEP { monetary thousand separator }
LOCALE_SMONGROUPING { monetary grouping }
LOCALE_ICURRDIGITS { # local monetary digits }
LOCALE_IINTLCURRDIGITS { # intl monetary digits }
LOCALE_ICURRENCY { positive currency mode }
LOCALE_INEGCURR { negative currency mode }
LOCALE_SDATE { date separator }
LOCALE_STIME { time separator }
LOCALE_SSHORTDATE { short date format string }
LOCALE_SLONGDATE { long date format string }
LOCALE_STIMEFORMAT { time format string }
LOCALE_IDATE { short date format ordering }
LOCALE_ILDATE { long date format ordering }
LOCALE_ITIME { time format specifier }
LOCALE_ITIMEMARKPOSN { time marker position }
LOCALE_ICENTURY { century format specifier (short date) }
LOCALE_ITLZERO { leading zeros in time field }
LOCALE_IDAYLZERO { leading zeros in day field (short date) }
LOCALE_IMONLZERO { leading zeros in month field (short date) }
LOCALE_S1159 { AM designator }
LOCALE_S2359 { PM designator }
LOCALE_ICALENDARTYPE { type of calendar specifier }
LOCALE_IOPTIONALCALENDAR { additional calendar types specifier }
LOCALE_IFIRSTDAYOFWEEK { first day of week specifier }
LOCALE_IFIRSTWEEKOFYEAR { first week of year specifier }
LOCALE_SDAYNAME1 { long name for Monday }
LOCALE_SDAYNAME2 { long name for Tuesday }
LOCALE_SDAYNAME3 { long name for Wednesday }
LOCALE_SDAYNAME4 { long name for Thursday }
LOCALE_SDAYNAME5 { long name for Friday }
LOCALE_SDAYNAME6 { long name for Saturday }
LOCALE_SDAYNAME7 { long name for Sunday }
LOCALE_SABBREVDAYNAME1 { abbreviated name for Monday }
LOCALE_SABBREVDAYNAME2 { abbreviated name for Tuesday }
LOCALE_SABBREVDAYNAME3 { abbreviated name for Wednesday }
LOCALE_SABBREVDAYNAME4 { abbreviated name for Thursday }
LOCALE_SABBREVDAYNAME5 { abbreviated name for Friday }
LOCALE_SABBREVDAYNAME6 { abbreviated name for Saturday }
LOCALE_SABBREVDAYNAME7 { abbreviated name for Sunday }
LOCALE_SMONTHNAME1 { long name for January }
LOCALE_SMONTHNAME2 { long name for February }
LOCALE_SMONTHNAME3 { long name for March }
LOCALE_SMONTHNAME4 { long name for April }
LOCALE_SMONTHNAME5 { long name for May }
LOCALE_SMONTHNAME6 { long name for June }
LOCALE_SMONTHNAME7 { long name for July }
LOCALE_SMONTHNAME8 { long name for August }
LOCALE_SMONTHNAME9 { long name for September }
LOCALE_SMONTHNAME10 { long name for October }
LOCALE_SMONTHNAME11 { long name for November }
LOCALE_SMONTHNAME12 { long name for December }
LOCALE_SMONTHNAME13 { long name for 13th month (if exists) }
LOCALE_SABBREVMONTHNAME1 { abbreviated name for January }
LOCALE_SABBREVMONTHNAME2 { abbreviated name for February }
LOCALE_SABBREVMONTHNAME3 { abbreviated name for March }
LOCALE_SABBREVMONTHNAME4 { abbreviated name for April }
LOCALE_SABBREVMONTHNAME5 { abbreviated name for May }
LOCALE_SABBREVMONTHNAME6 { abbreviated name for June }
LOCALE_SABBREVMONTHNAME7 { abbreviated name for July }
LOCALE_SABBREVMONTHNAME8 { abbreviated name for August }
LOCALE_SABBREVMONTHNAME9 { abbreviated name for September }
LOCALE_SABBREVMONTHNAME10 { abbreviated name for October }
LOCALE_SABBREVMONTHNAME11 { abbreviated name for November }
LOCALE_SABBREVMONTHNAME12 { abbreviated name for December }
LOCALE_SABBREVMONTHNAME13 { abbreviated name for 13th month (if exists) }
LOCALE_SPOSITIVESIGN { positive sign }
LOCALE_SNEGATIVESIGN { negative sign }
LOCALE_IPOSSIGNPOSN { positive sign position }
LOCALE_INEGSIGNPOSN { negative sign position }
LOCALE_IPOSSYMPRECEDES { mon sym precedes pos amt }
LOCALE_IPOSSEPBYSPACE { mon sym sep by space from pos amt }
LOCALE_INEGSYMPRECEDES { mon sym precedes neg amt }
LOCALE_INEGSEPBYSPACE { mon sym sep by space from neg amt }
LOCALE_FONTSIGNATURE { font signature }
LOCALE_SISO639LANGNAME { ISO abbreviated language name }
LOCALE_SISO3166CTRYNAME { ISO abbreviated country name }

URL:
http://delphi.cjcsoft.net//viewthread.php?tid=45725

Delphi : Set system locale information

So far this is what i had dig up on the topic. It made sense to post this one here since i am pretty sure somebody’s also looking for this info. Hehehe

Enjoy

Coffee Cup

procedure SetLocaleInfoSample;
var number, ds, lz;
begin
number := 0.7;

// Remember default number settings
ds := GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL);
lz := GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_ILZERO);

// Log a number using default settings
Log.Message( FloatToStr(number) );

// Log a number using a different decimal separator
SetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, ‘,’);
Log.Message( FloatToStr(number) );

// Log a number without the leading zero
SetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_ILZERO, ‘0’);
Log.Message( FloatToStr(number) );

// Restore original settings
SetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, ds);
SetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_ILZERO, lz);
end;

{
The function produces the following output for US English locale:

0.7
0,7
,7
}

procedure ChangeShortDate;
var strOldShortDate;
begin
// Get current short date format
strOldShortDate := GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SSHORTDATE);

if not SetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SSHORTDATE, ‘yyyy/MM/dd’) then
Log.Error(‘Could not change short date format.’);

// Restore original short date format
if not SetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SSHORTDATE, strOldShortDate) then
Log.Error(‘Could not restore original short date format.’);
end;

Windows : How to restart or shutdown your computer in command line or DOS mode

I know what you’re thinking, how come you need to know this thing if there is a shutdown or restart button.  Well, extra wisdom is better than nothing. I had a case where the shutdown and restart button is missing. My first guess is that the pc has been infected with a virus.

But just in case you encounter this scenario and you have the run command, you can type the following line

To shut down your computer, type: shutdown /s

To restart your compute,r type: shutdown /r

To log off your computer, type: shutdown /l

For a complete list of options, type: shutdown /?

After typing your chosen option, press Enter. The computer will execute your desired task.

How to add or remove password in MS Excel 2007

Had to chance up on encountering this problem again. Fortunately, you need to follow these steps in order to add or remove passwords in MS Excel 2007.

I have made a youtube video to show both the short version and the long version on how to achieve this.

For the short version here are the steps

Open Microsoft Excel 2017 workbook
Open the file to add or remove the password
Click the ORB logo on the top left
Click the ‘Save As’ button
Click the ‘Tools’ button and then click ‘General Options‘ tab
In the ‘Password to open’ box, add or delete the existing password then click ‘OK’.
Click the ‘Save’ button. If prompted, click ‘Yes’ to replace the existing workbook

Enjoy

Coffee Cup

Windows Server 2012 R2 Socket Network Error

Today is a new day. Mark and I installed a new windows server 2012 r2 and have also installed the drivers and software. We started using the Server Guide downloaded from the Lenovo Website and then the Operating System.

After installing, i loaded my app and hoped that it would run smoothly as always. But no, it did not push through as expected. I assigned the server with an ip address of #15. I use the DOS prompt ping and the ipaddress replied. I tried to look at the My Computer and typing the server name, and you can see the shared folders.

This is the whole message…
“EXCEPTION EBDE ENGINE ERROR IN MODULE XXX.EXE AT 00096F36. UNKNOWN DATABASE. UNABLE TO COMPLETE NETWORK REQUEST TO HOST ERVER_NAME? FAILED TO ESTABLISH A CONNECTION. A SOCKET OPERATION WAS ATTEMPTED TO A GENERAL SQL ERROR. UNREACHEABLE NETWORK ALIAS”

The error kept mentioning socket connection that was not successfuly. So what i did changed the ip address again. Lo and behold, i was able to run my app. Usually in normal windows pc the system should let you know if you have an ip address conflict. In this case, the server did not show that little dialog box.

It has been a very educational experience with conflicting ip address that in the windows server does not show you. Please note that the ip address belonged to a belkin device and not a PC or laptop. Maybe that could be the cause.

I tried to replicate the scenario in my Windows 7 pc and my pc reacted with a small message dialog of IP CONFLICT.

I have created a youtube video to show my adventure

Happy watching

Coffee Cup

S.O.P. Before Formatting a Windows Computer

As a programmer for some years already, I have seen my shares of people asking me to format their Windows PC.  And true enough, a lot of people in the IT world sometimes skip steps that I feel that I need to share to you guys in order not to suffer the horror of missing files and folders.

Many of my steps are pretty straight forward. And as the saying goes, an ounce of prevention is better than a pound of cure. I will also include scenarios that you may encounter along the way.

Step 1 – Prepare the Backup Hardware

Start first by preparing a large external drive or USB thumb drive beforehand. It would probably be a good idea if it would be empty and without your personal data so that just in case d files are infected with a virus or malware, your files are pretty safe.

Case Scenario: If you can still open the computer and you can still login, that is well and good for you. But just in case the windows operating system is corrupted or the user forgot their password, what you can do is you can install a windows operating system on top of the existing one to get the files. Just make sure not to erase and you want to keep the existing windows operating system.  Windows usually renames the old one as WINDOWS_OLD folder and Program Files to Program Files (OLD), I think. This step is a little tedious since you will be redoing the formatting again later to have a clean slate. But this step is surely worth the time.

Step 2 – Create Folders In Your External Drive

To me, I am a bit of an organization freak for files and folder. What I usually do is I start with the folders: Drive C, Drive D, Desktop, Documents, Pictures, Music and Videos. Once you have these folders you can start moving the files.

Bonus Tip: You may wonder why you want to move the file instead of copy. The reason for the move is so that just in case the operations get cut, you get to continue where you left off. Instead of guessing what folder you stopped on. Anyway, you get to format the whole drive so no need to leave the file in the hard drive.

For the Drive C and Drive D files, you get to see IT tech created folders like like util for utilities, or mboard for motherboard which is pretty important if you will format the computer. For me personally, I create folders like Software and Drivers to house all of the freeware software that I install. The reason in doing this is so that if a brother or sister or coworker needs the software that I installed, I just ask them to copy the software from the unit I just reformatted.

Step 3 – Use the Search or Find Window

Before we use the find option in windows to look for common files that we might have missed after our first sweep, please go to the Windows Explorer and open the hidden files and folders options. This tip is pretty useful if your pc is already infected with a virus as they always hide them from users.

Once you are done, try look for doc (MS Word), xls (MS Excel), pdf (Acrobat Reader), zip files. The most common file that we all have are jpg or jpeg picture files, not to mention the avi, mpeg or mp4 movie files.

Big tip no. 1: If the user is an architect, you might need to google file extensions for Autocad files. If your friend is an artist you might need to look for Adobe Photoshop or Corel Draw files.

Big tip no. 2: It is still best to ask what files he or she commonly uses especially if the user is a student. Sometimes they need file extensions needed for their school projects like Visual Studio files or Maya.

Step 4 – Backup the System Settings

In this step, we will be going to 4 settings in the Control Panel of the computer.  Before I usually open up Microsoft Paint press the print-screen on the keyboard to save each one per file. That was in the golden age when I haven’t even got my own mobile phone. These days, I use my phone’s camera to get a snapshot which is one of the wonders of modern technology.

  • Device Manger – To access this, you need to click the Devices The Device Manager tells you all of the drivers are located to make your computer works. If you did not find any driver installers on your computer, chances are, this is your best bet to know what the computer needs.
  • System Information – To access this, you need to go to click the System This page will tell you the computer name, and also the version of windows the user is running.
  • Software Installed – To access this, you need to go to click the Programs and Features. This page lists down all of the software the user uses. It is good to inform the user of the software that he needs to reinstall by himself. It’s not always guaranteed that what software he has you could bring back again. An example of these are game software (e.g. in my time, Red Alert, Warcraft and Star Craft) and specialized (e.g. software like Autocad and Adobe Suite that might require serial keys)
  • Network Settings – To access this, you need to click the Network and Sharing Center, then Change Adapter Settings. This step is needed if the computer you will try to format belongs to a computer or if it is for a school. Since both institutions sometimes configures devices like laptop to access their network using IP address and Default Gateways. This will take you to the individual LAN and WIFI adapter the computer has. You need to copy the IP address, Subnet Mask and Default Gateway if they are present. If both settings are set to Obtained IP Address Automatically, no need to do anything for this step.

Well, that’s it for me. After following these steps, you should be able to proceed with formatting the computer with a clear conscience that your friend or office mates would not be crying by your side for lost and unrecoverable files.

Solved – Windows cannot connect to the printer. The local print spooler service is not running

When adding a printer on a network, it seems that sometimes something creeps up from the woodwork that you haven’t seen before.

If you have been in my line of business for quite some time, you wouldn’t be shocked anymore.  It’s like for the Ghost busters. Once they see a ghost, they just put their game face on.

For me, this is a bit of a problem. You usually find the user on the file explorer and right click connect right??? in this case, an error occurs

“Connect to Printer

Windows cannot connect to the printer. The local print spooler service is not running. Please restart the spooler or restart the machine”

Reading it again now it occurred that it was pointing where you need to go. Yeah the service.msc if you are using windows.

  • In the Services.msc, right-click Print Spooler and click Properties.
  • If the service is not automatic, right-click the service and choose Properties and select Automatic
  • The last step should be that the service must be Started.

 

Now for me, i had to do this 2 times because the first time i changed the settings, it did not push through (i think) so i had to go back in again and change it for the second time around.

After that, i was able to connect to the printer through the network.

Till next time…

Pocket Calculator Turns On by Itself and Keyboard is Shorted

I had a case today where the several pocket calculators turned on by itself and some of them even types a digit by itself.

another strange thing is the keyboard of the computer seems to keep the solid green light while the USB mouse seems to be unaffected by this strange scenario.

i transferred the cpu to another location and tested and it turned out fine. no hangs no keyboard anomaly or any of that.

then finally, somebody suggested that the monitor is the culprit. i changed the monitor and all is well.

the monitor is now relocated to the archives and this is quite an x-files episode i can tell you that.  life in the computer world just got it’s own taste of the paranormal. if somebody can explain it to me in layman’s terms i would really appreciate it. hahaha.

Coffee Cup