×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

ShellExecute, to run an internal Windows (DOS) command

ShellExecute, to run an internal Windows (DOS) command

ShellExecute, to run an internal Windows (DOS) command

(OP)
thread184-1638430: hide DOS command box using ShellExecute
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

RE: ShellExecute, to run an internal Windows (DOS) command

At a quick glance, your code looks OK to me. What is your question?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: ShellExecute, to run an internal Windows (DOS) command

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

RE: ShellExecute, to run an internal Windows (DOS) command

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
https://www.doschke.name

RE: ShellExecute, to run an internal Windows (DOS) command

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close