Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calling a program in program files folder
Message
De
24/01/2013 14:39:46
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2008
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01563955
Message ID:
01563995
Vues:
61
This message has been marked as the solution to the initial question of the thread.
>>>Hi all,
>>>
>>>I have a customer who wants to call a scanning program automatically. Should be no problem so I've put the location of the exe file into a memo filed and call it with the Run command, nothing happens. If I call other programs on a mapped drive they start fine, if I call other programs in the c:\test1 folder they start fine. The program location I am trying to call is
>>>c:\program files\hp\hp laserjet mfp 400abc\bin\scan.exe
>>>When I click on my button to run this exe the dos box pops up very briefly and disappears but the scan.exe program does not start. From a security point of view I have added everyone with full control to the hp laser... folder and also ensures that those right are similar in the bin folder. I have opened a dos box and typed in the location and file as one command and it started so I'm baffled on this one.
>>
>>Spaces in the path... did you include quotation marks around the filename?
>I've tried it both with and without quotes, the code I run is below
>
>mrunfile = ALLTRIM(memo1)
>RUN &mrunfile
>
>memo1 contains "C:\Program Files\HP\HP LaserJet 400 MFP M425\bin\HPScan.exe". I have tried doing this by hard coding in the location of the file as well. If I change the above to C:\folde1\program.exe it works.
>~M

Looks like a problem due to the spaces in the file name/path. I can't remember the last time I used macro substitution but you need to surround your command with quotes in order to get it to work.

Something like this might work:
mrunfile = "'" + alltrim(memo1) + "'"
RUN &mrunfile.
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform