Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeder2.enfer-du-nord.net!gegeweb.org!.POSTED!not-for-mail From: vincent.belaiche@gmail.com (Vincent =?iso-8859-1?Q?Bela=EFche?=) Newsgroups: comp.lang.basic.visual.misc Subject: Getting some system information via VBSCript Date: Wed, 10 Jul 2013 12:16:43 +0200 Organization: Gegeweb News Server Lines: 57 Message-ID: <8061win2ic.fsf@gmail.com> NNTP-Posting-Host: arennes-353-1-12-253.w92-135.abo.wanadoo.fr Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: obelix.gegeweb.org 1373451527 72213 92.135.107.253 (10 Jul 2013 10:18:47 GMT) X-Complaints-To: abuse@gegeweb.org NNTP-Posting-Date: Wed, 10 Jul 2013 10:18:47 +0000 (UTC) User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (windows-nt) Cc: =?iso-8859-1?Q?Vincent_Bela=EFche?= Cancel-Lock: sha1:TZ3QaKiaHMcIupOC0iOPBxH2uT0= Xref: csiph.com comp.lang.basic.visual.misc:1798 Hello, I have written the following script '####################################################################### Dim oFSO Set oFSO = WScript.CreateObject("Scripting.FileSystemObject" ) Const iIS_DIRECTORY = 16 Const iIS_READ_ONLY = 1 Function HasWriteAccess(sFolderName_IN) 'As String Dim oFolder Set oFolder = oFSO.GetFolder(sFolderName_IN) Dim iAttr iAttr = 0 On Error Resume Next iAttr = oFolder.Attributes Set oFolder = Nothing If ((iAttr And 16 ) <> 0) And ((iAttr And 1 ) = 0) Then HasWriteAccess = "true" Else HasWriteAccess = "false" End If End Function Dim oWshShell, sPrograms, sWritablePrograms Set oWshShell = WScript.CreateObject("WScript.Shell" ) sPrograms = oWshShell.SpecialFolders("Programs") sWritablePrograms = HasWriteAccess(sPrograms) WScript.Echo "Programs=" & sPrograms WScript.Echo "WritablePrograms=" & sWritablePrograms '###################################################################### and when I run it the response is as follows: '###################################################################### Microsoft (R) Windows Script Host Version 5.7 Copyright (C) Microsoft Corporation 1996-2001. Tous droits réservés. Programs=C:\Documents and Settings\Vincent\Menu Démarrer\Programmes WritablePrograms=false '###################################################################### Now, this answer seems wrong to me, because if I open some command line console and I do: Rem ################################################################### cd /D "C:\Documents and Settings\Vincent\Menu Démarrer\Programmes" mkdir toto Rem ################################################################### That will work without error, i.e. --- contrary to the script response I do have write access on special folder "Programs". Any help is welcome. Vincent.