G
Guest
Trying to udate 2000 SP4 by calling createprocess from C++ api. (This is for generic SP update code to be run off a CD.) I have updated NT SP 6a using create process. This 2000 code is identical. Works for NT but not for 2000. For 2000 an error is returned. For 2000 I changed it to call system passing the path to SP4 exe.
Any ideas why create process does not work? I have double checked for typos and tried the createprocess call with differnet args. (We do not want the system DOS box to display - which is the biggest reason for not wanting to call system.
CString SrcFileName = m_csSrcPath + "\\W2KSP4\\"
CString csExec = SrcFileName + "W2KSP4_EN.EXE" + " /u /q /n /z /o"
CString ApplicationName = m_csSrcPath + "\\W2KSP4\\W2KSP4_EN.EXE"
bRes = CreateProcess ( (char *)(const char *)ApplicationName,(char *)(const char *)csExec,NULL,NULL,TRUE,NORMAL_PRIORITY_CLASS,NULL,NULL,&si,&pi)
// This does not work
Res = CreateProcess ( NULL,(char *)(const char *)csExec,NULL,NULL,TRUE,NORMAL_PRIORITY_CLASS,NULL,NULL,&si,&pi)
// This works
int isys = system(csExec)
Any ideas why create process does not work? I have double checked for typos and tried the createprocess call with differnet args. (We do not want the system DOS box to display - which is the biggest reason for not wanting to call system.
CString SrcFileName = m_csSrcPath + "\\W2KSP4\\"
CString csExec = SrcFileName + "W2KSP4_EN.EXE" + " /u /q /n /z /o"
CString ApplicationName = m_csSrcPath + "\\W2KSP4\\W2KSP4_EN.EXE"
bRes = CreateProcess ( (char *)(const char *)ApplicationName,(char *)(const char *)csExec,NULL,NULL,TRUE,NORMAL_PRIORITY_CLASS,NULL,NULL,&si,&pi)
// This does not work
Res = CreateProcess ( NULL,(char *)(const char *)csExec,NULL,NULL,TRUE,NORMAL_PRIORITY_CLASS,NULL,NULL,&si,&pi)
// This works
int isys = system(csExec)