Information générale
Catégorie:
Fonctions Windows API
Thank you George for continuing to assist me. I am not sure I know what you mean by quotes and spaces. should it be ( in vfp):
commandline = "c:\program files\cadcam\cadcam.exe"
commandline= ["]+ commandline + ["}
And..... I have a new wrinkle that needs your talent.
If you double click on a file called c:\cadcam\my CadFile.cad, the file opens in the correct editor. I guess the install program made the proper associations for the cad files. How can I utilize WScript to simulate a double click on c:\cadcam\my CadFile.cad so it will open in the proper editor. Then I could use VFP to activate the editor and display the file.
Dr. G. (Neil)
>>Hi George,
>>Thanx for the referance to the article. It worked. I have a question
>>
>>how come:
>>wshShell=createobj("WScript.Shell")
>>wshShell.Run("calc")
>>works just fine
>>
>>but.....
>>
>>wshShell.run("c:\program files\cadcam\cadcam.exe")
>>does not work.
>>If I place "c:\program files\cadcam\cadcam.exe" in the RUN textbox, it will work but not when I use the above syntax in the scripting host
>>
>>And....
>>what is the vfp syntax for wshShell.Sleep 100? I tried wshShell.run(100) and that did not work.
>>
>>Regards,
>>Dr. G. (Neil)
>
>The problem you're having is with the embedded spaces in the file name. The string should include the quote marks so the shell realizes it's an LFN.
>
>The answer to the second part is to use the Sleep API call, since VFP doesn't have access to the WScript object itself. You'll find a sample of this in the article on the VFUG site.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement