VB Script new boy

Discussion in 'Scripting & Programming' started by MAZDAN, Jul 8, 2004.


    MAZDAN Bit Poster

    Does any one know if or how you can set variables / check variables on a local XP Box via VB Script (Login Script)

    Within XP you can set variables manually. (We currently use this to setup printer locations). To see these variables do the following:-

    Right click my computer, Properties, Advanced, Environment Variables, System Variables. Example :- Name = “Update” Value = “2”

    What I am trying to do is set a variable on a local machine i.e. Update 1. I need a logon script to look at the variable and if it is not equal to the hard coded value run copy procedure example:-

    xcopy /e /i /h /r /k /y "X:\Templates\Start" "C:\Documents and Settings\All Users\Start Menu\"

    Then after running the copy procedure update the local variable to the new value

    Update System Variables Set Variable Value = 2


    Do nothing

    Does anyone have any suggestions?


  2. nugget
    Honorary Member

    nugget Junior toady

    Hi Mazdan
    I was hoping that someone could answer your question, Phil (I think) as he is pretty good at this scripting business.

    I've recently done some vb scripting but mainly with making registry changes. As far as I see you need to read the value from somewhere, compare it to a given variable and write a change if necessary. I normally do these in the registry with regread and regwrite commands providing you know where the keys are.

    Sorry I can't be of more help.
    Certifications: A+ | Network+ | Security+ | MCP (270,271,272,290,620) | MCDST | MCTS:Vista
    WIP: MCSA, 70-622,680,685
  3. Phil
    Honorary Member

    Phil Gigabyte Poster

    Hi Mazdan, Nug

    Sorry, I did start looking at this last week but life is pretty manic round here at the moment (too much work and not enough hours in a week) and I ended up getting sidetracked. I'll try and take a look this evening when I get home.

    Certifications: MCSE:M & S MCSA:M CCNA CNA
    WIP: 2003 Upgrade, CCNA Upgrade

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.