Re: ShellExecute and copy, delete command
From: Tim Robinson (tim.at.gaat.freeserve.co.uk_at_invalid.com)
Date: 04/14/04
- Next message: Igor Tandetnik: "Re: Pointer to multidimensional array"
- Previous message: Tim Robinson: "Re: C++ DLL callable from VB6"
- In reply to: Gary: "ShellExecute and copy, delete command"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 14 Apr 2004 19:44:15 +0100
Gary wrote:
[...]
> Then I tried ShellExecute(NULL,
> "open", "copy", "sourcefile destfile", "", SW_HIDE), but it failed.
> 0x00000002 returned as the HINSTANCE variable. I guess it means
> "Could not find the path" or something.
The COPY command is internal to the Command Prompt, CMD.EXE. ShellExecute is
looking for a program called COPY.EXE which doesn't exist.
> Is that possible to use
> ShellExecute to do the file manipulation job? If we cann't, how to
> do that in a hide window?
You could use ShellExecute to spawn a copy of CMD.EXE to do the copy, but
that's the hard way. It's much better to use the built-in Win32 functions to
do what you want: CopyFile, MoveFile, DeleteFile and the rest. You might
also want to look at SHFileOperation, which Explorer uses to copy, move,
delete etc. files.
-- Tim Robinson (MVP, Windows SDK) http://mobius.sourceforge.net/
- Next message: Igor Tandetnik: "Re: Pointer to multidimensional array"
- Previous message: Tim Robinson: "Re: C++ DLL callable from VB6"
- In reply to: Gary: "ShellExecute and copy, delete command"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|