Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OFSO = CREATEOBJECT('Scripting.FileSystemObject') not wo
Message
From
23/07/2012 09:23:04
 
 
To
23/07/2012 08:41:57
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01548984
Message ID:
01548992
Views:
68
>>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform