Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OFSO = CREATEOBJECT('Scripting.FileSystemObject') not wo
Message
De
23/07/2012 09:23:04
 
 
À
23/07/2012 08:41:57
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01548984
Message ID:
01548992
Vues:
69
>>>I am trying to use Sergey's change attribute routine to make a file read/write
>>>
>>>I am using
>>>
>>>oFSO = CREATEOBJECT("Scripting.FileSystemObject")
>>>
>>>
>>>but i GET AN ERROR IT DOES NOT EXIT
>>>
>>>windowa 2003 - vfp 9.2
>>>
>>>how can I get around it
>>
>>You must install Windows scripting.
>>Many sysadmins didn't install it by default.
>
>
>how do you do that?

You don't, since it may be prohibited at the company due to strict safety standards. Instead you can use this function:
FUNCTION SetAttr
PARAMETER tFileName, tAttribute
tAttribute = UPPER(tAttribute)
Private nAttribute
nAttribute=0
If 'S'$tAttribute && System
   nAttribute = nAttribute + 4
Endif    
If 'H'$tAttribute && Hidden
   nAttribute = nAttribute + 2
Endif    
If 'R'$tAttribute && ReadOnly
   nAttribute = nAttribute + 1
Endif    
If 'A'$tAttribute && Archive
   nAttribute = nAttribute + 32
Endif    
If 'N'$tAttribute && Normal
   nAttribute = nAttribute + 128
Endif    
declare integer SetFileAttributes IN kernel32 STRING, INTEGER 
Return SetFileAttributes(tFileName,nAttribute)=1
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform