![]() |
How can I use ShellExecute() with if and else commands?
Hello
Very simple problem I have here. If network share is found, open it in explorer. Else open LocalFolder1. If LocalFolder1 isn't found, open LocalFolder2. Current code; Code:
#include <windows.h>Thanks in advance, Panarchy |
Re: How can I use ShellExecute() with if and else commands?
ShellExecute should return something based on the data opened successfully or not found kind of thing
|
Re: How can I use ShellExecute() with if and else commands?
Oh?
Could you please tell me how I can set it up to do so? Thanks in advance, Panarchy |
Re: How can I use ShellExecute() with if and else commands?
Quote:
Example Code:
if(ShellExecute('Your Sample Params Above') == ERROR_PATH_NOT_FOUND) |
Re: How can I use ShellExecute() with if and else commands?
Thanks for replying.
Do you think the following code would work?; Code:
if(ShellExecute(NULL, "explore", "\\\\panarchy\\share", NULL, NULL, SW_SHOWNORMAL); == ERROR_PATH_NOT_FOUND)Thanks in advance, Panarchy PS: The reason I can't test it myself is because I don't have any shares on my network. EDIT: Just tried it, did not work. Here is my complete log file; Quote:
|
Re: How can I use ShellExecute() with if and else commands?
Run and see if it works because at times return value is not always TRUE / FALSE which needs to be tested.
|
Re: How can I use ShellExecute() with if and else commands?
Hello
Still not working for me. Have simplified it as much as I can, here is my complete code; Code:
#include <windows.h>Quote:
Thanks in advance, Panarchy |
Re: How can I use ShellExecute() with if and else commands?
There are lots of error of basic programming and not related to shell execute and I would try to point some of them
Code:
if(ShellExecute(NULL, "explore", "\\\\panarchy\\share", NULL, NULL, SW_SHOWNORMAL); == ERROR_PATH_NOT_FOUND)In the last post you have else without an if. |
Re: How can I use ShellExecute() with if and else commands?
Thanks for replying.
However, I still don't understand. Here is my latest code; Code:
#include <windows.h>Please tell me how to get my code to work! For the end result I am wishing, there is 1 network (UNC) path & 2 local paths. Please help me reach my goal! Thanks in advance, Panarchy |
Re: How can I use ShellExecute() with if and else commands?
It would not
Code:
if(ShellExecute(NULL, "explore", "\\\\panarchy\\share", NULL, NULL, SW_SHOWNORMAL); == ERROR_PATH_NOT_FOUND);Code:
if(ShellExecute(NULL, "explore", "\\\\panarchy\\share", NULL, NULL, SW_SHOWNORMAL) == ERROR_PATH_NOT_FOUND); |
| All times are GMT +5.5. The time now is 21:28. |