Month: December 2013

Nice introduction to EVA and AVX for Android

Advertisements

Cantonese on Android, Apple, and Microsoft Products

Very interesting topic about Cantonese and let us know where to get Cantonese input for different OS.

Hong Kong and Cantonese

I find it interesting that even though we tend to deny Cantonese the same (if any) prestige that we give Mandarin in the world by not teaching it in schools or universities, calling it a “dialect,” and overall advocating the more “proper” use of Mandarin for economic upward mobility and business, quite prominent companies include Cantonese language features to attract consumers, perhaps indicative of the lucrativeness of the Cantonese-speaking market that predominantly resides in Hong Kong.

For one, Android products include Google voice typing using Cantonese, specifically labeled “粵語 (香港),” alongside Mandarin features for China and Taiwan. And while I don’t think Android includes a Cantonese language keyboard feature, one can use the free HKIME application to type using Cantonese romanization (I’m not sure if it’s Jyutping – it’s called “Canton Pinyin” on the keyboard), Cangjie, stroke, among others. There’s another application, Cantonese keyboard, that some reviews say works…

View original post 708 more words

List mapped printers for current logon user in Windows 7.

If you ever think of getting a list of mapped printers for current logon user, you might had Google for List mapped printer Windows 7.

I see some nice scripts from  Spicework and Technet, the Technet one will list mapped drives as well. The script is kind of lengthy and I do not bother to read and understand what it is doing, so I start to think of another simplier approach.

In Windows XP, we have some built-in scripts for printer management. For more information about this, you may want to visit Techrepublic.  Those scripts is still here with Windows 7, but at a different path, Techrepublic had another article about this.

To list printers of the current logon user, run the following in the command prompt:

cscript C:\Windows\System32\Printing_Admin_Scripts\en-US\PRNMNGR.vbs -l

The result from the command will list out the mapped printers with some extra info, if all you need is the printer names, you may want to run the following instead:

cscript C:\Windows\System32\Printing_Admin_Scripts\en-US\PRNMNGR.vbs -l|find /I "printer name"

If you want to list out the default printer only, run the following:

cscript C:\Windows\System32\Printing_Admin_Scripts\en-US\PRNMNGR.vbs -g|find /I "default"

Some may want to redirect the output of the command to a text file like with username and computername as below:

cscript C:\Windows\System32\Printing_Admin_Scripts\en-US\PRNMNGR.vbs -l|find /I "printer name" > c:\temp\%USERNAME%-%COMPUTERNAME%-Mapped_Printer.txt

Many would ask, how to run that script on a remote computer to get the list of mapped printers for the current logon user on that remote host. My approach is to run it with owexec from Office Warfare. To be able to use owexec to run a command as the current logon user, you will need to have local admin right for that remote host.

First, modify the script to redirect to an UNC path as it would be pointless to drop the result on that local machine.

cscript C:\Windows\System32\Printing_Admin_Scripts\en-US\PRNMNGR.vbs -l|find /I "printer name" > \\server\public$\printer\%USERNAME%-%COMPUTERNAME%-Mapped_Printer.txt

Next, put the script into a batch file (getmapprinter.bat) and run the following comand:

owexec.exe -c computername -k getmapprinter.bat -copy

You should be able to find the result at the path above.

[AutoIT] Check free disk space for multiple drives.

Sometimes you may want to check for the free disk space for multiple drives, even multiple computers in your network. If you are a server guy or someone with domain admin rights, you may want something more robust such as Lansweeper, Spiceworks, Open-AudIT, Zabbix, Nagios, OCS Inventory NG or the like to do an inventory. What if you are just a desktop admin?

The traditional way is to map the drives and jot down the free space manually, but that would not work if you have a large numbers of drives to check. I wrote the following code to accomplish the task, all you have to do is create a text file with one drive letters/UNC path per line and drag and drop it to the executable (alternatively, you can pass the text file’s filename as a parameter to the executable). The result will be presented in a Excel table.

#include <Excel.au3>
If $CmdLine[0] < 1 Then
    MsgBox(0, "Error", "Please provide text file as parameter.")

    Exit
EndIf
$file = FileOpen($CmdLine[1], 0)

$lineNo = 1

If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf

Local $oExcel = _ExcelBookNew() ;Create new book, make it visible
If @error Then
    MsgBox(0, "Error", "Unable to create Excel instance.")
    Exit
EndIf

;Writing the header
_ExcelWriteCell($oExcel, "Disk", 1, 1)
_ExcelWriteCell($oExcel, "Free Space", 1, 2)
_ExcelWriteCell($oExcel, "Total Space", 1, 3)

While 1
    $line = FileReadLine($file)
    If @error = -1 Then ExitLoop

    $lineNo = $lineNo + 1

    ;Write the disk name
    _ExcelWriteCell($oExcel, $line, $lineNo, 1)
    ;Write the disk free space
    _ExcelWriteCell($oExcel, (Round( (DriveSpaceFree($line)/1024 ),2) &" GB"), $lineNo, 2 )
    ;Write the total disk space
    _ExcelWriteCell($oExcel, (Round( (DriveSpaceTotal($line)/1024 ),2) &" GB"), $lineNo, 3 )

Wend

FileClose($file)

The compiled executable including source file and project file for ISN AutoIT Studio can be downloaded here.

Feel free to download drivespace.zip from the link above.

For simplicity, not much error checking had been implemented and the code is provided as is.

Windows Reliability Monitor

Windows Reliability Monitor has been around since Windows Vista, it basically summaries the reliability of your computer from the event log. These includes failure/success of installation, program crash and even hardware error as below. There is also an option to report the problem and if a solution is available, it will prompt you with the solution (which is usually an update version of the software).

 

Windows Reliability Monitor Video Error

Video Error

WMI Explorer for those who are interest in WMI programming

For those of you who are interest in WMI programming, tools like WMI code Creator and Scriptomatic can be useful. The command wbemtest might come in handy sometimes as well but I find that WMI Explorers are more useful when you would like to know what classes are avaiable and when you would like to run and see what results does the Query produces.

I find the following three WMI Explorer to be very useful:

Happy programming 🙂

[AutoIT] IDE for AutoIT, ISN AutoIT Studio

As an AutoIT programmer, I had problem dealing with large scale program as AutoIT doesn’t have a decent IDE. Searching for a decent IDE, I found ISN AutoIT Studio. One of the best I had seen ever.

More information and screenshots can be found at: http://www.autoitscript.com/forum/topic/136766-isn-autoit-studio/

Download at: http://www.isnetwork.at/