I'm trying to use the createprocess function to start an xsession, but so far I've been unsuccessful. Here is the code I'm trying to use:

_tcscpy(tszCommandLine, _T("C:\\Program Files\\Hummingbird\\Connectivity\\12.00\\Exceed\\Xstart.exe C:\\Documents and Settings\\username\\Application Data\\Hummingbird\\Connectivity\\12.00\\Profile\\XSW3.xs"));
    CreateProcess(NULL, tszCommandLine, NULL, NULL, FALSE, NULL,
              NULL, NULL, &si, &pi);

If I try to make the XSW3.xs the only command line parameter, the program runs but nothing happens. I would appreciate any help.

Thanks,
Smed

The argument to XStart.exe contains spaces, so you need to wrap double quotes around it. See red

_tcscpy(tszCommandLine, _T("C:\\Program Files\\Hummingbird\\Connectivity\\12.00\\Exceed\\Xstart.exe \"C:\\Documents and Settings\\username\\Application Data\\Hummingbird\\Connectivity\\12.00\\Profile\\XSW3.xs\""));

thanks!

Is there a way that I could have something typed into the command line upon creation? For instance, have it type "cd folder1" as soon as the xsession window is created.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.