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);
getcwd(olddir, MAX_PATH);
if (lpCurrentDir)
{
// changing working directory
chdir(newdir);
}
system(cmd);
chdir(olddir);
if (newdir) free(newdir); if (cmd) free(cmd);
Subscribe to Posts [Atom]
Scrape It |