Adding Registry keys with VBS.

Posted on 2005-04-12
Last Modified: 2012-06-27

I need to add a registry key and a few strings under it under the HKEY_CURRENT_USER\Software\ section

i need to add a value in there called name but have it query active directory or use a environment lookup to look at the person that is logged in and grab the full name and insert it in this key

Also the same the the extension number. Which i have also store in active direcotory.

I have 1 key that is a path..which will be c:\documents and settings\current user? ( im not really user what i can use for the vbs script to use the current users profile path here?

can anyone tell me how i can use a vbs script to add registry keys and use these lookups?
Question by:plimpias
    LVL 23

    Accepted Solution


    Expert Comment

    Windows Shell com interface has these options, I believe.

    LVL 15

    Author Comment

    Im not sure I understand how I would get the vbs script to add the name of the person logged in into a string value under the registry. Thanks cookre for the info on creating the keys with vbs. But im just not quite sure how to insert the full name of the person logged in into a key??
    LVL 23

    Expert Comment

    In the firsrt link above, see objUser.userPrincipalName.

    I presumed that's the item you wanted.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
    A short article about a problem I had getting the GPS LocationListener working.
    This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now