Windows Vista Forums

Script to hide a variable folder
  1. #1


    Crx Guest

    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

  2. #2


    Joe Fawcett Guest

    Re: Script to hide a variable folder

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

    >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

  3. #3


    Crx Guest

    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:

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

    > >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

  4. #4


    Joe Fawcett Guest

    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

    > 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:
    >

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

    >> >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

Script to hide a variable folder problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Script switch parameter as variable ewannema PowerShell 3 27 Jan 2009
creating Environment variable during logon script Elgordo VB Script 1 15 Dec 2008
return variable through script in script NIDU VB Script 1 18 Sep 2008
Hide CMD prompt on HTA Script CleberMarques.com VB Script 3 29 May 2008
Current script special variable Frank PowerShell 1 01 Mar 2007