Daqing Chu At WordPress

January 25, 2011

Parse and Transform Text File by Using PowerShell (3)

Filed under: Programming Notes — David Chu @ 4:16 am

In my previous blog, I described who I parsed the input text file from my debug result to generate the first report table. Now Let’s continue to the second report.

[Read more…]

January 24, 2011

Parse and Transform Text File by Using PowerShell (2)

Filed under: Programming Notes — David Chu @ 4:13 am

With the previous blog on the basic concepts and the project goals on your belt, now it is time to jump into the codes from 6000 feet height.

[Read more…]

January 18, 2011

Parse and Transform Text File by Using PowerShell (1)

Filed under: Programming Notes — David Chu @ 6:17 am

I have used my DebugLog class to investigate issues in Visual Studio projects. The debug messages are pushed to Visual Studio’s output consol. The generated messages may be very extensive huge. For example, I had a case of a Windows application with performance issues of DAO calls. I got about 8233 lines of debug messages just from the start to the main window displayed. I copied the messages to a text file. It is 732K in size. I like to keep the raw messages there; however, it was hard to investigate issues with the extensive raw messages.

[Read detail…]

December 15, 2010

PowerShell Tip: Dynamic Data Type

Filed under: Programming Notes — David Chu @ 6:01 am

I have used Powershell for quite a while. I really enjoy its power and great features. I did not spent time to learn PS thoroughly. I just learn it by examples and by demand. The main reason is that PS covers so wide areas. I don’t have time to learn it in a long time span.

[Read more…]

November 20, 2010

Powershell Scripts and Batch File

Filed under: Programming Notes — David Chu @ 9:58 pm

Normally I create a PS script project and then run it as a job in a batch file. Occasionally, I need to execute a batch job from my PS script. Here are two tips.

[

August 23, 2010

App Installation as Admin in Windows Server 2008

Filed under: Programming Notes — David Chu @ 1:46 am
Tags: ,

Today at work, I tried to get help from Capstone on their application work in Windows Server 2008. The application is a 32-based application as a VBS script host with ability to communicate with their ParcView suite. The application has a configuration setting for data connection, by using UDL connection string.

[Read more…]

December 7, 2009

SysInternals Tool: PsExec.exe

Filed under: Programming Notes — David Chu @ 2:10 am
Tags: , ,

PS supports remote process. That means you may run a process on a remote Windows. Recently I was working on a project which requires to run a process on a remote Windows box. I tried to use WMI process to start a process on remote. It works on one box (Windows XP), but the same codes do not work on a Windows 2008 server.

Read the full blog ».

December 1, 2009

Zip Files with PowerShell Script

Filed under: Programming Notes — David Chu @ 1:01 pm

Recently I have been working on backup files from a remote server in network to another server PC. I use SyncToy tool to sync files from the remote to the server. Each time when you run the SyncToy, it will generate a SyncToy.log file as in “C:\Documents and Settings\username\Local Settings\Application Data\Microsoft\SyncToy\2.0\SyncToyLog.log”. What I need to do is to copy the SyncToy.log file from that location to a specified location and zip to a monthly file as my log, for example, “C:\synclog\synctoy_122009.zip”.

Read the full blog ».

November 21, 2009

VIM Syntax Settings

Filed under: Programming Notes — David Chu @ 10:28 pm
Tags: ,

Recently I started to learn and working on Windows PowerShell scripts. PowerGUI is a nice tool as script IDE or editor. However, when I wanted to write a blog on PowerShell with some example script codes, I have to use VIM or MacVim to convert codes to HTML. By default, my VIM does not have syntax vim file for PowerShell, since it is a new script language. Then I searched for the ps1.vim on web. It does not take much time to find out one at vim.org’s syntax library

Read the full bog ».

Blog at WordPress.com.