subzero349
Technical User
Hi,
I'm using the following code to execute a dos executable (FullPath) with some arguments and switches (ActiveFileNameAndSwitches):
"ShellExecute(Handle,'open',Pchar(FullPath),Pchar(ActiveFileNameAndSwitches), nil,SW_SHOWNORMAL);"
The code does work, and it does execute the dos program. BUT my problem is this:
I have code above this that sets the PATH in the registry. I also have code that updates windows with the new path immediately (tested and working). The ShellExecute() does not seem to take the new reg changes though, it only uses the original settings. I know windows is updating immediately because I can open the command prompt (start->run->cmd) and with a few tests I can easily see that the PATH is changing right away.
So... why is this happening? Do i have any other options to run code in a dos window? do I have to close the cmd when it's finished? do I have to "create" a process?
Please help! I have no idea why it's not working!
I'm using the following code to execute a dos executable (FullPath) with some arguments and switches (ActiveFileNameAndSwitches):
"ShellExecute(Handle,'open',Pchar(FullPath),Pchar(ActiveFileNameAndSwitches), nil,SW_SHOWNORMAL);"
The code does work, and it does execute the dos program. BUT my problem is this:
I have code above this that sets the PATH in the registry. I also have code that updates windows with the new path immediately (tested and working). The ShellExecute() does not seem to take the new reg changes though, it only uses the original settings. I know windows is updating immediately because I can open the command prompt (start->run->cmd) and with a few tests I can easily see that the PATH is changing right away.
So... why is this happening? Do i have any other options to run code in a dos window? do I have to close the cmd when it's finished? do I have to "create" a process?
Please help! I have no idea why it's not working!