Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Changing System variables from CMD

  • 10-01-2005 2:52pm
    #1
    Closed Accounts Posts: 583 ✭✭✭


    I need to change both System and User variables on a friends pc (XP). This person is not computer literate in the slightest. I was just wondering is there anyway you can change the System and User variables from the Command line. This way I can just put them into a batch job and he can just run it and all is well


Comments

  • Registered Users, Registered Users 2 Posts: 1,375 ✭✭✭DoesNotCompute


    I think you can do this by using the set command. For example:

    "set temp = c:\temp"

    will set your windows temporary directory as "c:\temp".


  • Registered Users, Registered Users 2 Posts: 990 ✭✭✭galactus


    The SET command within a batch file is the way forward:
    http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds_shelloverview.mspx

    Since the above link is to a Microsoft web page the link will automatically self-destruct at a random point in time in the future ;)


  • Closed Accounts Posts: 583 ✭✭✭stuey


    cheers i'll give it a look


  • Registered Users, Registered Users 2 Posts: 37,485 ✭✭✭✭Khannie


    using set in a batch file will only change the variables for within that dos box (i.e. it wont affect the overall system settings, except within that dos box, which dies when the batch is finished (if it's double clicked)).

    Dunno if the fabled "autoexec.bat" file still exists for within XP. Last I saw of it was in Win9x.

    <edit>
    If I'm not making any sense, let me know. I use environment variables a lot in work.
    </edit>


  • Moderators, Society & Culture Moderators Posts: 9,689 Mod ✭✭✭✭stevenmu


    No it's gone, it might have been in Windows Me but it's gone as of 2000/XP. Altough I think there may be some way of having an autoexec.bat that will execute everytime you open a cmd window. *quick check* Yep use "cmd /k c:\autoexec.bat" as the command line to start the dos box.

    As for the original question it's probably just easier in the long run to talk him/her through it, not much harder than a batch file anyway and that way it'll be persistent.


  • Advertisement
  • Closed Accounts Posts: 583 ✭✭✭stuey


    but there is an autoexec.bat in windows xp. is it just there for show or what?

    I know what your saying about just talking them through it but I will have to do this for a number of people as well and some sort of automated procedure would be far more effective.


  • Registered Users, Registered Users 2 Posts: 1,375 ✭✭✭DoesNotCompute


    maybe you could use javascript or vbscript to edit some registry values that represent the values you wish to change? of course this assumes that there are seperate registry values for every system variable, and I don't know if that is the case.


  • Closed Accounts Posts: 583 ✭✭✭stuey


    well i figured out a solution and it rather simple
    a .reg file

    I figured out where system variables and user varibales are stored in the registery and made a fix.reg file with all the changes i needed to make. When the user double clicks the fix.reg file it does the usual crap "do you want to add blah blah...." makes the changes and it worked perfectly

    thanks for all ur help


  • Closed Accounts Posts: 7,488 ✭✭✭SantaHoe


    Hmmm, did you try:
    Right-Click My Computer -> Properties -> Advanced -> Environment Variables
    ?


  • Closed Accounts Posts: 1,502 ✭✭✭MrPinK


    stuey wrote:
    but there is an autoexec.bat in windows xp. is it just there for show or what?
    As far as I know it's just for occasions such as this. The system doesn't use it any more, but the user can still stick in anything they want and it will run on startup.


  • Advertisement
  • Closed Accounts Posts: 583 ✭✭✭stuey


    jesus santahoe do u think im thick?

    i needed to do it on mutliple pcs which i dont have direct access to and the people aren't pc literate so i just wanted an easy way to do it and the.reg files were the way to go. cause they worked perfectly

    thnax for all ur help


  • Moderators, Society & Culture Moderators Posts: 9,689 Mod ✭✭✭✭stevenmu


    Can you be sure that way that you're not changing any enviroment variables that other programs they have might have set, or are you able to just add in your own ?


  • Closed Accounts Posts: 583 ✭✭✭stuey


    well in this case all the pcs had the same software and i was actually only adding variables and was only modifing one so i just took that one down and added what i wanted to it and then put the whole lot into a .reg file.

    What ur saying is do-able tho. How i couldn;t tell ya. It would just require a bit o code of some sort to pull the data from the registery and add what u need to it. Im actaully working on this now!!


  • Closed Accounts Posts: 7,488 ✭✭✭SantaHoe


    stuey wrote:
    jesus santahoe do u think im thick?
    Not at all... I was just curious.
    Was very tired last night when I posted that, I missed the bit about multiple machines.


  • Closed Accounts Posts: 583 ✭✭✭stuey


    SantaHoe wrote:
    Not at all... I was just curious.
    Was very tired last night when I posted that, I missed the bit about multiple machines.

    Im sorry it cam accross like i was angry i was only joking ;)


Advertisement