Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ShellExecute, to run an internal Windows (DOS) command

Status
Not open for further replies.

jinfeld

IS-IT--Management
Sep 9, 2003
1
US
thread184-1638430
Regarding the use of ShellExecute, to run an internal Windows (DOS) command like rmdir, dir, mklink use these options

Example: make a symbolic link folder named "Linkedfolder" which refers to the network path \\server2\wip

DECLARE INTEGER ShellExecute IN shell32.dll ;
INTEGER hndWin, ;
STRING cAction, ;
STRING cFileName, ;
STRING cParams, ;
STRING cDir, ;
INTEGER nShowWin
hndWin = 0 &&this seems to be the only option to use
cFileName = "cmd.exe"
cAction = "open"
cParams = [/k mklink /D "Linkedfolder" "\\server2\wip"]
cDir = ""
nShowWin = 1 &&use 0 to hide the DOS window
ln_result = ShellExecute(hndWin,cAction,cFileName,cParams,cDir,nShowWin)
if ln_result >= 32
wait window "Success" timeout 4
ENDIF
 
I get that your making an example, but actually all of those commands are available in VFP without the need to run ShellExec.


Best Regards,
Scott
MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"Everything should be made as simple as possible, and no simpler."[hammer]
 
MLLINK for creating symlinks, hard links or junctions is not creating HTML links, Scott. At least that's where you are wrong about VFP also offering that internally. There may be other ways aside of the MKLINKDOS command, API functions of Windows, to handle this, but the only thing missing in the post is making it a tip rather than a normal thread.

So I'd say that's a welcome tip, jinfeld. Not a usual way to start, but I' also post unasked advice sometimes.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Hi Olaf,
I must have missed that in his list, everything I saw was about directory manipulation... so that one seems out of place for the others he's listed.
In any case I'm growing suspicious of this post, since the OP hasn't returned... especially since they "joined" in 2003, and this is their first post ever.
Looks like an account that's been hijacked if you ask me.


Best Regards,
Scott
MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top