Re: Running BAT file via ShellExecute by Brian
Brian
Wed Aug 09 06:17:02 CDT 2006
Andrew,
Nope. ShellExecute(0, 'open', lcPath+'\'+lcFile, '', '', 2) doesn't work for
me with a UNC path or otherwise.
I have to CD or SET DEFAULT to the path first.
Regards,
Brian
"Andrew Howell" <ajh@work> wrote in message
news:OYneuj4uGHA.4752@TK2MSFTNGP02.phx.gbl...
> "Brian McKillop" <brian.nospamforme@mckillopassociates.com.au> wrote in
> message news:BhfCg.9263$rP1.690@news-server.bigpond.net.au...
>>I kick off a BAT file from within my VFP7 app with something like this...
>>
>> lcPath = "C:\MyPath"
>> lcFile = "MyFile.BAT"
>> CD (lcPath)
>> ShellExecute( 0, "open", lcFile, "", "", 2 )
>>
>> All works OK.
>>
>> However, if lcPath has a value of [\\MyPC\c\MyPath] the ShellExecute
>> doesn't seem to work.
>>
>> SYS(5) + SYS(2003) return the expected value of [\\MyPC\c\MyPath] at that
>> point.
>> FILE(lcPath + "\" + lcFile) returns .t.
>>
>> Any ideas?
>
> Not sure why it doesn't work, I only have FPW which has no CD command and
> I don't seem to be able to set default to a UNC.
> I can ShellExecute path+file together though, what does
>
> ShellExecute(0, 'open', lcPath+'\'+lcFile, '', '', 2)
>
> do for you?
>
> --
> regards
> Andrew Howell
>