Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

createprocess

dpharmdpharm Member Posts: 22
want to open Ms Word using createprocess; having problems; what am i doing wrong? this is the code i have
CreateProcess(NULL, "Winword.exe C:Documents and SettingsAll UsersStart MenuPrograms

Comments

  • AsmGuru62AsmGuru62 Member Posts: 6,519
    : want to open Ms Word using createprocess; having problems; what am i doing wrong? this is the code i have
    : CreateProcess(NULL, "Winword.exe C:Documents and SettingsAll UsersStart MenuPrograms
    :
    [blue]
    Few problems:

    1. I hope Windows 'knows' the full path to winword.exe file. If not it can fail. Does the program open at all?

    2. The backslash characters in path should be coded with TWO backslashes.

    3. If full path contains blanks - the whole path should be taken into double quotes:

    [code]
    CreateProcess (NULL,
    "Winword.exe [red]"[/red]C:[red][/red]Documents and Settings[red][/red]All Users[red][/red]Start Menu[red][/red]Programs[red]"[/red]");[/code]
    [/blue]
Sign In or Register to comment.