Tuesday, August 21, 2012

Several CMD Commands in parallel Execution


start cmd.exe /c "C:\Program Files\Mozilla Firefox\firefox.exe"
exit
start cmd.exe /c "C:\Program Files\Microsoft Office\OFFICE11\OUTLOOK.EXE"
exit

1. make these commands as *.bat file.

2. Keep this new *.bat file in "C:\Documents and Settings\All Users\Start Menu\Programs\Startup" location.

3. While login windows OS, it will invoke the above *.exe automatically.

Advantage:
** It will reduce the number of user interaction for every login.

Friday, August 3, 2012

QuickSort function Sample Code

//Program to sort names in an array using quicksort
#include <stdio.h
>
#include<conio.h>
#include <stdlib.h>
#include <string.h>

int sort_function( const void *a, const void *b);

char list[5][4] = { "cat", "car", "cab", "cap", "can" };

int main(void)
{
int x;
clrscr();
qsort((void *)list, 5, sizeof(list[0]), sort_function);
for (x = 0; x
< 5; x++)
printf("%s ", list[x]);
getch();
return 0;
}

int sort_function(const void *a,const void *b)
{
return( strcmp((char *)a,(char *)b) );
}