|
cmd /c sc create -- binPath= "cmd /c start calc" type= own type= interact & net start -- &
sc delete --
|
Friday, June 22, 2012
Running Application/Process using System Account
Thursday, May 13, 2010
WSH object and Usage
Following is a list of WSH objects and its typical usage. I found it extremely useful ( courtesy MSDN)
| Object | What you can do with this object |
| · Set and retrieve command line arguments · Determine the name of the script file · Determine the host file name (wscript.exe or cscript.exe) · Determine the host version information · Create, connect to, and disconnect from COM objects · Sink events · Stop a script's execution programmatically · Output information to the default output device (for example, a dialog box or the command line) | |
| Access the entire set of command-line arguments | |
| Access the set of named command-line arguments | |
| Access the set of unnamed command-line arguments | |
| · Connect to and disconnect from network shares and network printers · Map and unmap network shares · Access information about the currently logged-on user | |
| Create a remote script process using the Controller method CreateScript() | |
| · Remotely administer computer systems on a computer network · Programmatically manipulate other programs/scripts | |
| Access the error information available when a remote script (a WshRemote object) terminates as a result of a script error | |
| · Run a program locally · Manipulate the contents of the registry · Create a shortcut · Access a system folder · Manipulate environment variables (such as WINDIR, PATH, or PROMPT) | |
| Programmatically create a shortcut | |
| Access any of the Windows Special Folders | |
| Programmatically create a shortcut to an Internet resource | |
| Access any of the environment variables (such as WINDIR, PATH, or PROMPT) | |
| Determine status and error information about a script run with Exec() Access the StdIn, StdOut, and |
Wednesday, February 03, 2010
Express IT - A Series of Technical Seminars

Wednesday, September 23, 2009
PDM Works Vault deletion error
I had uninstalled PDMWorks from my machine. Later, when i attempted to remove the vault from machine, it threw a "Conisio" dialog stating
Tuesday, September 08, 2009
Google Doodle Solved.
Sunday, June 07, 2009
Tips for buying Laptop
Thursday, May 21, 2009
Installshield Error
Friday, May 08, 2009
Clearing "saved" network passwords
Quite often we "save" passwords for frequently used network resources and later end up asking ourself, how the hell are we going to erase it ?
Unlike email or any other services, there isn't any place to remove the cached files and remove the saved password. Or do we think so ? In fact, you can do it.
Execute the following statements and you have the list you want.
"rundll32.exe keymgr.dll, KRShowKeyMgr"
Saturday, April 25, 2009
Software Craftsman Vs Industrial Programmer
Friday, March 13, 2009
Disable restart after Win update
The bothersome "Updating your computer is almost complete. You must restart your computer for the updates to take effect. Do you want to restart your computer now?" is one message most Win XP users are irritated with.
Quite often we would be engrossed in some work and this irritating dialogs start prompting you every 10 Mins.
Here is a way to disable this prompt.
Start / Run / gpedit.msc / Local Computer Policy / Computer Configuration / Administrative Templates / Windows Components / Windows Update / Re-prompt for restart with scheduled installations
You can enforce the Group Policies by “gpupdate.exe /force” command without having to restart the system
Tuesday, February 10, 2009
Expression Blend 2.0 and Silverlight 2.0
Expression Studio 2.0 which packages Expression Blend 2.0 would support only Silverlight 1.0 applications. This would happen even if your system is acquitted with Silverlight 2.0. Silverlight 2.0 is packaged along the 2.5 version of Expression Blend.
To develop Silverlight 2.0 application using Expression Blend 2.0 you would need to install "Microsoft Expression Blend™ 2 Service Pack 1". This would give you the option to develop Silverlight 2.0 from the 2.0 version of Expression Studio. Of course, you would need DotNet Framework 3.5 SP1 to go along with it.
Saturday, January 31, 2009
Access Denied for MSC files / Administrative Tools in Windows.
Recently when I tried to start any of the Administrative Tools ( .msc files ) in my system ( Windows XP Home Edition ), I encountered a strange "Access Denied" error even though I was logged in as the administrator.
It seemed strange as Administrator, I should have access to these tools and such a response seemed odd.
The problem was the .msc file types had lost it's association. So once I ensured that msc files are opened using the Microsoft Management Console or mmc.exe, I could resolve the issue in no time.
Thursday, January 29, 2009
Nant And WhiteSpaces.
Whitespace in file paths can lead to a tricky problem while writing Nant Scripts. Quite we end up with "Path not found" errors only because whitespace in the folder/file names .
Work around under such circumstances is very simple, use the 8.3 format for that particular file/folder and your script is all set.
By the way, NantBuilder is quite a handy tool.
Monday, December 01, 2008
CMYK Vs RGB in FrameMaker
I was importing a Image (JPEG) to Adobe FrameMaker when a certain image started throwing weird problems. Each time I import image, the image's color seems changed drastically.
A bit of googling and the solution seemed simple. The image was in CMYK format and i needed to change it to RGB to get it working properly in FrameMaker.
Simple, straightforward..i wonder why Adobe doesn't the same inbuilt inside the FrameMaker. Better they do.
Saturday, September 27, 2008
Missing Address Bar in Explorer for Windows Xp Home
Missing Address bar in your Windows Explorer/Internet Explorer in Windows XP Home Edition ??
Go to the following Registry key:
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Toolbar
For Windows Explorer: In the right pane, locate the Explorer sub-key and open it. In the right pane, locate the ITBarLayout value. Right click this value and select Delete.
For Internet Explorer: In the right pane, locate the WebBrowser sub-key and open it. In the right pane, locate the ITBarLayout value. Right click this value and select Delete.
That's it. Restart your application and you have your address bar back.
Saturday, May 31, 2008
Modulo Operation : Microsoft vs Google
Modulo operation is something we all aware of from long time and this , infact brings out an interesting perspective on how Microsoft and Google has implemented it. Try out finding the result for following operation in C# or VB or even Windows Calculator.
"-5 mod 6"
Your result was -5 right ??? Now attempt the same in Google Calculator ?? -1 the result ??
Which is correct ? Its going to be an interesting argument. The Modulo function is definaed as the amount by which a number exceeds the largest integer multiple of the divisor that is not greater than that number.
Now if you go by that defination , - 5 * -1 would yield 5 with a remaining -1. That would explain the answer given by Google. But Microsoft's answer too can be argued.
The normal formula to calculate Mod is given by r = a - n(a/n). Now assuming Microsoft calculates this using r = a - n * abs(a/n) , then answer given by Calculator is correct.
Counter argument exists in both cases and hence it is argueable on sides of both parties about which is the correct solution.
Monday, May 26, 2008
Acer Predator : A Real Beast
Speaking about Ultimate PC's and it couldn't have got better.Just couldn't resist writing about this beast machine , awesome configuration and an equally awesome design. Acer Aspire Predator G7700 come across as ultimate gaming machine that you can dream of.
![]() | ![]() |
| Acer Aspire G Predator G7700 specifications | |
| Item | Description |
| CPU Support | Intel Core 2 Extreme or Core 2 Quad up to 133MHz FSB |
| Chipset | Nvidia nForce 780i SLI |
| System memory | Up to 8GB DDR2 1066/800MHz |
| Hard drives | 4x SATA HDD up to 1TB |
| Optical drives | Blu-ray SuperMulti burner |
| Graphics | 3-way SLI ready |
| Audio | Onboard HD 7.1 audio |
| Dimensions | 490×430×190mm (L×H×W) |
Thursday, May 15, 2008
C# coding Guidelines - An alternate naming scheme
I have always felt hard to agree with the naming schemes for variables under the "C# Coding standards", which on other grounds is a very find document.
According to Microsoft, they strictly oppose the use of Hungarian notations. Furthermore, they advise on using camelCase for naming all local, member and parameter variables. Microsoft advocate that it increases readability by supporting a consistent naming scheme throughout.
This is something I dont agree with. My argument is simple. How would one recognize between local, member and a parameter variable ?? i believe, it would have been helped readability furthur if we had naming scheme such that all 3 types of variables can be differentiated.
So what i recommend is
Local Variables : camelCase
Member Variable : "m_" or "g_" prefixed to the name
Parameter Variable : PascalCase
These are my personal views and i did find the readability much improved in this way.
Monday, March 03, 2008
Locking USB Storage in your System
I wanted prevent users from connecting a USB Storage device to my system. It wasnt as cubersome as i initially thought it would be. Microsoft had provided this wonderful KB article (823732) which give a very good explanation of the same.
There are two scenario's that needed to be thought of.
1. If USB Storage Device is not installed in your System.
2. If USB Storage device is already installed in your system.
Under the first circumstances, we can disable the access by making usbstor.inf and usbstor.pnf files under the SystemRoot directory secure from the users.
On other hand under the second circumstances , we can change the value of UsbStor in the registry to accomplish our goals.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor
Changing the value of "Start" to "4" would prevent the USB Drive from getting detected.
Thats it, you have locked up USB storage devices from being connected to your system
Friday, February 22, 2008
Setting NULL DACL for NamedPipe
When using NamedPipe, security access is major concern. By default, the created NamedPipe can be accessed only by the administrator accounts. But what if you application requires it be to accessed by a client application run in a "Limited User" account ??
This is where you need to set the security attributes. The security attributes can be set using the last parameter of CreateNamedPipe API call.
Easiest ( yet not-recommended) way of giving access to Limited User Account is setting the security Attribute using a Null DACL. ( Discretionary Access Control List ).
[DllImport("kernel32.dll", SetLastError = true)]
public static extern IntPtr CreateNamedPipe(
String pipeName,
uint dwOpenMode,
uint dwPipeMode,
uint nMaxInstances,
uint nOutBufferSize,
uint nInBufferSize,
uint nDefaultTimeOut,
IntPtr lpSecurityAttributes);
Point To Note : Remember, setting a NULL value to lpSecurityAttributes and setting a NULL Dacl for it is two entirely different thing. If you set a Null Value for lpSecurityAttributes , it would be mean that the pipe would be having default security privileges set by the operating system.
But when you set the value as NULL Dacl, you are saying to the operating system that the pipe can be accessed by all users in the system, ie , giving Full-Control to "Everyone" user group.
So how do you set the Null Dacl for lpSecurityAttributes ? here is a bit of code for the same
SECURITY_DESCRIPTOR sd = new SECURITY_DESCRIPTOR();
InitializeSecurityDescriptor(ref sd, SECURITY_DESCRIPTOR_REVISION);
SetSecurityDescriptorDacl(ref sd, true,IntPtr.Zero , false);
SECURITY_ATTRIBUTES sa = new SECURITY_ATTRIBUTES();
sa.nLength = Marshal.SizeOf(typeof(SECURITY_ATTRIBUTES));
IntPtr ptr = Marshal.AllocHGlobal(Marshal.SizeOf(sd));
Marshal.StructureToPtr(sd, ptr,true);
sa.lpSecurityDescriptor = ptr;
IntPtr retPtr = Marshal.AllocHGlobal(Marshal.SizeOf(sa));
Marshal.StructureToPtr(sa,retPtr,true);
PipeHandle = CommonFunctions.CreateNamedPipe(
PIPE_NAME,
PIPE_ACCESS_DUPLEX ,
PIPE_TYPE_MESSAGE |
PIPE_READMODE_MESSAGE |
PIPE_WAIT,
PIPE_UNLIMITED_INSTANCES,
(uint)BUFFER_SIZE,
(uint)BUFFER_SIZE,
0,
retPtr);


