Tuesday, November 07, 2006

change dir to execute the command

char olddir[MAX_PATH] = "", *newdir = NULL, *cmd = NULL;
getcwd(olddir, MAX_PATH);
if (lpCurrentDir)
{
// changing working directory
chdir(newdir);
}
system(cmd);
chdir(olddir);
if (newdir) free(newdir); if (cmd) free(cmd);

Labels: ,


Comments: Post a Comment

Subscribe to Post Comments [Atom]





<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]

Scrape It
Free Hit Counters
Scrape It