Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Script to hide a variable folder

Reply
 
Old 08-26-2008   #1 (permalink)
Crx


 
 

Script to hide a variable folder

I am new to VB and I need a vb script that does the following:

1) Check to see that %rootvar%\roam is hidden (%rootvar% is an environment
variable defined prior to this script running)
2) If it is not hidden, then alter the attributes to hide it
3) If it is hidden, take no action

Any help will be much appriciated

-CX

My System SpecsSystem Spec
Old 08-26-2008   #2 (permalink)
Joe Fawcett


 
 

Re: Script to hide a variable folder

"Crx" <Crx@xxxxxx> wrote in message
news:20C7D6B9-DE8B-4610-97AA-4F54F8C584D5@xxxxxx
Quote:

>I am new to VB and I need a vb script that does the following:
>
> 1) Check to see that %rootvar%\roam is hidden (%rootvar% is an
> environment
> variable defined prior to this script running)
> 2) If it is not hidden, then alter the attributes to hide it
> 3) If it is hidden, take no action
>
> Any help will be much appriciated
>
> -CX
Seems like a fairly straightforward batch script:

ATTRIB +H %rootvar%\roam /D

(Not tested)

Doesn't check whether it's hidden first but I don't see why that matters.

--

Joe Fawcett (MVP - XML)

http://joe.fawcett.name


My System SpecsSystem Spec
Old 08-26-2008   #3 (permalink)
Crx


 
 

Re: Script to hide a variable folder

Joe,

Yea, I know about attrib using a bat file, I was hoping I can get the same
thing done using a vb script. It sounds like an easy task; well maybe not.

-CX

"Joe Fawcett" wrote:
Quote:

> "Crx" <Crx@xxxxxx> wrote in message
> news:20C7D6B9-DE8B-4610-97AA-4F54F8C584D5@xxxxxx
Quote:

> >I am new to VB and I need a vb script that does the following:
> >
> > 1) Check to see that %rootvar%\roam is hidden (%rootvar% is an
> > environment
> > variable defined prior to this script running)
> > 2) If it is not hidden, then alter the attributes to hide it
> > 3) If it is hidden, take no action
> >
> > Any help will be much appriciated
> >
> > -CX
> Seems like a fairly straightforward batch script:
>
> ATTRIB +H %rootvar%\roam /D
>
> (Not tested)
>
> Doesn't check whether it's hidden first but I don't see why that matters.
>
> --
>
> Joe Fawcett (MVP - XML)
>
> http://joe.fawcett.name
>
>
>
My System SpecsSystem Spec
Old 08-27-2008   #4 (permalink)
Joe Fawcett


 
 

Re: Script to hide a variable folder

Documentation on the attributes property of the FileSystemObject:
http://msdn.microsoft.com/en-us/libr...43(VS.85).aspx

--

Joe Fawcett (MVP - XML)

http://joe.fawcett.name

"Crx" <Crx@xxxxxx> wrote in message
news:4ECDC43F-60C2-4474-80BF-1C8A88D40C45@xxxxxx
Quote:

> Joe,
>
> Yea, I know about attrib using a bat file, I was hoping I can get the same
> thing done using a vb script. It sounds like an easy task; well maybe not.
>
> -CX
>
> "Joe Fawcett" wrote:
>
Quote:

>> "Crx" <Crx@xxxxxx> wrote in message
>> news:20C7D6B9-DE8B-4610-97AA-4F54F8C584D5@xxxxxx
Quote:

>> >I am new to VB and I need a vb script that does the following:
>> >
>> > 1) Check to see that %rootvar%\roam is hidden (%rootvar% is an
>> > environment
>> > variable defined prior to this script running)
>> > 2) If it is not hidden, then alter the attributes to hide it
>> > 3) If it is hidden, take no action
>> >
>> > Any help will be much appriciated
>> >
>> > -CX
>> Seems like a fairly straightforward batch script:
>>
>> ATTRIB +H %rootvar%\roam /D
>>
>> (Not tested)
>>
>> Doesn't check whether it's hidden first but I don't see why that matters.
>>
>> --
>>
>> Joe Fawcett (MVP - XML)
>>
>> http://joe.fawcett.name
>>
>>
>>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Script switch parameter as variable PowerShell
creating Environment variable during logon script VB Script
return variable through script in script VB Script
Hide CMD prompt on HTA Script VB Script
Current script special variable PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46