~ Mayank Johri’s Tips ~

November 11, 2008

TIPS: DELTREE in Windows XP

Filed under: Tips, Windows — mayankjohri @ 1:43 pm
Tags: ,

deltree can be simulated using the following .cmd file:

  1. Create an empty file deltree.cmd in %windir%\system32 folder
  2. Add the following content to the file, and save the file.

@echo off
del /S /F /Q %1
rd /S /Q %1

September 22, 2008

Disable “Use the web service to find the appropriate program”

Filed under: Tips, Windows — mayankjohri @ 8:03 pm
Tags: ,

Create the following DWORD key NoInternetOpenWith = 1 at

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer

September 12, 2008

Imaging WinXP using Knoppix

Filed under: Tips, Windows — mayankjohri @ 1:22 pm
Tags: ,
  1. Boot from knoppix
  2. Repartition your drive
    1. Base Partition – This is were your winXP is installed
    2. Image Partition – this is were your image of windows xp will be copied
  3. mount the  image partition: mount /dev/sda2 /media/img
  4. Use the command to create the img: ntfsclone -s -o /media/img/winxp.img /dev/sda1
  5. use the command to restore the img: ntfsclone  –restore-image -O /dev/sda1  /media/img/winxp.img
  6. Enjoy

Note: It is a good idea to have ext3 as filesystem for your image partition so that the image file is not deleted accidentally and also it overwrites the FAT32 2GB filesize limit.

July 5, 2008

Get the windows service state using Python

Filed under: Python, Tips, Windows — mayankjohri @ 10:55 pm
Tags: ,

following code can be used to find if any service is installed and if so then return the state of the service.

import wmi

class servicePython():
    def __init__(self, serviceName):
        self.c = wmi.WMI ()
        self.serviceName = serviceName

    def setServiceName(self, serviceName):
        self.serviceName = serviceName

    def getStatus(self):   
        srv = c.Win32_Service (name=self.serviceName)
        if srv != []:
            return c.Status
        return False

June 9, 2008

PitHole: Windows : The specified service has been marked for deletion

Filed under: Windows — mayankjohri @ 1:30 pm
Tags:

When I try to install the install a service which i have just delete using sc command i get the following error :

“The specified service has been marked for deletion”.

Just close the services.msc and try again. otherwise one might have to restart the machine :( to resolve the issue.

April 15, 2008

Disable the “Use the Web service to find the correct program” Dialog

Filed under: Tips, Windows — mayankjohri @ 8:23 pm

Create the following DWORD key NoInternetOpenWith = 1 at

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer

March 3, 2008

A nice Defrag Utility

Filed under: Tips, Windows — mayankjohri @ 9:21 pm
Tags:

Today i came across a nice  defrag utility which is free and have most of the features, One can download it from http://www.defraggler.com/.

January 26, 2008

Get Processes along with parameters

Filed under: Windows — mayankjohri @ 6:48 pm

Click Start, Run and type CMD

Type the command given below:

WMIC /OUTPUT:C:\ProcessList.txt PROCESS get Caption,Commandline,Processid

or

WMIC /OUTPUT:C:\ProcessList.txt path win32_process get Caption,Processid,Commandline

August 14, 2007

Add Context Menu for a FileType

Filed under: Windows — mayankjohri @ 4:38 pm

Eg:

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\\.osd]
@="SoftGrid.osd.File"
"Content Type"="application/softricity-osd"
[HKEY_CLASSES_ROOT\\SoftGrid.osd.File\\shell\\UpdateOSD]
[HKEY_CLASSES_ROOT\\SoftGrid.osd.Fileshell\\UpdateOSD\\Command]
@="\"C:Program Files\\AddTabsToOSD\\addTabsToOSD.exe\" \"%1\""

The above reg key will add UpdateOSD menu for .osd file type

May 15, 2007

Adding Network shortcuts in MSI packages

Filed under: MSI, Windows — mayankjohri @ 12:33 pm
Tags: ,

Steps

  1. Create a property eg. INSTDIR in Property table
  2. Populate it with the network directory
  3. Create a property eg SHORTCUT1 in Property table /* IF not using Wise
  4. Polulate it with the full UNC path along with the executable name  /* IF not using Wise.
  5. Create a shortcut using the shortcut under the shortcut table
  6. Update the WkDir coloum in Shorcut table with INSTDIR (no NOT add brakets [] before and after INSTDIR).

Blog at WordPress.com.