Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changing windows files permissions by code
Message
De
22/11/2006 11:18:02
 
 
À
22/11/2006 10:54:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
01171171
Message ID:
01171805
Vues:
7
In ths case WSH is simply a shell for ShellExecute, AFAIK.

>Indeed, WSH must be available, as I pointed out. On your local machine it probably is. In my shareware app Clickwork, WSH functions are forbidden. However, the advantage of WSH is its simplicity as compared to most other solutions. For me, the ShellExecute is also okay in this case, as Alexandre pointed out.
>
>>Why not use the WinAPI ShellExecute function which does not require that WSH is installed?
>>
>>>Good tip.
>>>
>>>If WSH is allowed, one can use that for the use of CACLS. The advantage is that, as compared to using RUN, the appearance of the dos-window can be suppressed with the 3rd parameter.
>>>
>>>
oShell = createobject("WScript.Shell")
>>>lcRun = "CACLS file.txt /P JIM:F < yes.txt"
>>>lnRC = oShell.Run(lcRun, 1, .T.)
>>>
>>>
>>>>What about using CACLS.EXE since that is present on any machine running winnt 4 or above.
>>>>
>>>>>>True. However, it is more than nothing. What do you additionally suggest?
>>>>>
>>>>>I thought of SetFileSecurity but I don't have ready out of the box code for that one.
>>>>>Cetin
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform