Page 1 of 3 123 LastLast
Results 1 to 12 of 26

Thread: Windows XP environment variables ?

  1. #1
    Registered
    Join Date
    Feb 2008
    Location
    earth
    Posts
    529
    Downloads
    0
    Uploads
    0

    Question Windows XP environment variables ?

    Hi everybody,

    Does anyone know how to define/set an environment variable before Windows XP boots & reads the registry information ?

    I want to have an environment variable that is defined/set automatically each time I power On the computer, at pre-boot time before XP wants to read the info from the registry.

    Do you think ti's doable ? How ?

    Please guys, I need your help on this one !

    Thanks !
    cnc2.


  2. #2
    Registered
    Join Date
    Sep 2009
    Location
    UK
    Posts
    29
    Downloads
    0
    Uploads
    0
    You can set environment variables in XP via Control Panel -> System. Then choose the "Advanced" tab and there is a button at the bottom to set environment variables. You can set either user variables or system variables. I believe they get stored in the registry and get read as XP loads.

    Is that what you're after? If not, what are you trying to achieve?

    Glenn


  3. #3
    Registered
    Join Date
    Feb 2008
    Location
    earth
    Posts
    529
    Downloads
    0
    Uploads
    0
    Thanks Glenn for the fast reply !

    No, this isn't what I was after, I already know how to set "normal" environment variables, but what I want to do is to modify the boot sequence so that it dynamically sets an environment variable BEFORE the registry is read...a bit like launching a small batch program before the system wants to read the registry at pre-boot time.

    Any idea ?

    Thanks !
    cnc2.


  4. #4
    Registered
    Join Date
    Sep 2009
    Location
    UK
    Posts
    29
    Downloads
    0
    Uploads
    0
    I think the only other way is to edit the autoexec.bat in the system root folder. This is a real throwback to the days of DOS ... but the file has remained. I believe the contents of this file are ignored by windows except for any SET commands.

    To add a variable you would do something like:

    SET MYVAR=C:\SOMEWHERE\SOMETHING

    I suppose the challenge now would be to have something that changes the variable in the autoexec.bat before launching Windows. I'm not sure if that's possible.

    Perhaps this link will be useful: http://www.tomshardware.co.uk/forum/...5059_35_0.html

    The last post in that link seems an interesting option. I think you could use it to specify a registry entry to run a .bat in the start of the Windows load sequence. Perhaps that would enable you to get the appropriate env vars pre-login:

    HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\BootExecute

    It's been a while since I wrote .bat files but I seem to recall you can set menu choices which could be used for setting different options.

    Sorry I can't provide an out-of-the-box solution to this and I wish you good luck.

    Glenn


  • #5
    Registered
    Join Date
    Feb 2008
    Location
    earth
    Posts
    529
    Downloads
    0
    Uploads
    0
    Thanks for your help Glenn !

    You've posted some great info, but i realise that i didn't explain well.

    To sum everything: I need to NOT rely on the registry, & this by setting a variable before the boot loader reads the registry, i know this won't be easy because of the importance the registry has...My final goal is to trick the system & make it look for the registry at a different place than usual...a bit like...i make different copies of the registry & at boot time the environment variable is set by a batch file that reads the path i define in a text file(the path to the reg copy i want to load) or instead of reading a txt it'll just call another batch i modify manually.

    I had thought about autoexec.bat but it was a great deception when i read that on Win XP the autoexec.bat was parsed at login time(too late) unlike in Win98 where it is parsed at pre-boot time.

    Thanks Glenn, i really apreciate your help.
    cnc2.


  • #6
    Registered
    Join Date
    Sep 2009
    Location
    UK
    Posts
    29
    Downloads
    0
    Uploads
    0
    I don't think that's possible. MS did away with the DOS OS layer when it got to XP. Now XP IS the OS.

    Last advice is to see what can be done in the boot.ini but I don't think it can be scripted nearly as much as autoexec.bat used to be.

    Perhaps you'll find better software dev advice from another forum rather than here.

    Good luck ...
    Glenn

    PS. You're not doing anything dodgy are you ... circumventing software licensing etc? ;-) I wouldn't want to offer help (well, ... trying to help) if you were!


  • #7
    Moderator Switcher's Avatar
    Join Date
    Apr 2005
    Location
    mydxf.blogspot.com
    Posts
    3,665
    Downloads
    0
    Uploads
    0
    PS. You're not doing anything dodgy are you ... circumventing software licensing etc? ;-) I wouldn't want to offer help (well, ... trying to help) if you were!
    LOL

    What about a boot CD?

    It will start before the C-drive, If you have the CD setup to start first.
    Free DXF Files - myDXF.blogspot.com


  • #8
    Registered beege's Avatar
    Join Date
    Feb 2008
    Location
    USA
    Posts
    546
    Downloads
    0
    Uploads
    0
    While this doesn't address your particular situation, I know that anything in the "Start Menu/Startup" subdirectory is run automatically after logging in. If you have a batch file in there, it could set variables at that time. I'd start reading about the Linux boot loaders "grub" and "Lilo" to see if a multi-boot system would do what you want it to, Or VMWare, or some "boot magic" software is available for that purpose.


  • #9
    Registered
    Join Date
    Feb 2008
    Location
    earth
    Posts
    529
    Downloads
    0
    Uploads
    0
    Thanks to every one for the replies !

    Well, I'm not trying anything doggy & I don't intend to defeat the Windows software registration ...etc, cracks for Windows are widely availabe on the net & I don't need to get in that kind of business.

    If I succeed in solving this "little" problem, It'll be possible to use an install of windows & register it as usual, transparently in the system I'm designing, If for some reasons I can't solve this problem then, my system will require a corporate version of windows that doesn't need registration...The wrong thing about the corporate version, is that it will narrow the use of my system to the owners of a corporate version of Windows, making my system away from the reach of the common people.

    On the sysinternals forum I've been told that the paths are coded in the "configuration manager" which is not explained in the "Windows internals 4th edition"...but on a website I've found that it's Ntldr that locates & reads the registry/hives.

    I've found an old post on a forum, talking about reverse engineering ntldr, it said that inside ntldr there's an "embeded" exe, osloader.exe...it would be cool if I could change the paths to suite my needs, but i'm not sure it's doable.

    I would also need to somehow read the mac address of the NIC 0 & include it in the path...it'd be perfect....yea but will require a lot of old programming skills to do it in asembler.

    Ok, if i'll have to reverse ntldr then, my project will remain experimental until Microsoft agrees to make an official patch to implement this freature.

    Any ideas ?

    Thanks !
    cnc2.


  • #10
    Registered
    Join Date
    Jul 2005
    Location
    UK
    Posts
    447
    Downloads
    0
    Uploads
    0
    Have you considered the windows embedded version of XP. Its cheaper per licence then XP retail, and doesnt require authentication as its designed for embedded systems. Also you can highly customise the image. There is a free 180 day trial available from microsoft if you want to give it a try.


  • #11
    Registered
    Join Date
    Feb 2008
    Location
    earth
    Posts
    529
    Downloads
    0
    Uploads
    0
    Thanks for the reply daedalus !

    I heard about XPE when I was looking for an enhanced write filter for XP & found it was only available for XPE.

    But, why is XPE cheaper than the retail XP ?
    Is there any difference for the common office employee, in using XPE ? Maybe hardware limits ? Network limits ? What about ActiveDirectory & XPE ? Ms Office ...etc ?

    How many people are using XPE ?

    Thabks !
    cnc2.
    Last edited by cnc2; 10-14-2009 at 10:26 PM.


  • #12
    Registered
    Join Date
    Jul 2005
    Location
    UK
    Posts
    447
    Downloads
    0
    Uploads
    0
    XPE is designed for embedded applications, such as when OEMs ship a piece of hardware with XP preinstalled under the hood.

    The main difference is you can customise XPE images a lot more than XP, but its not really designed for 'office environments'. The embedded products are usually a little cheaper to encourage people off linux solutions for the same problem. Its mainly used in things like kiosks, newer vending machines, Point of Sale machines, bank ATMs, etc.

    It would help if you describe exactly what your trying to do. When you mention installing windows without having to register / set up, is this just a user annoyance issue, or something else (like not being networked when this happens)?

    Are you selling hardware to people that has windows installed on it? If so could you sell with MS preinstalled?

    EDIT: i realised i didnt really answer your question. Hardware, network, AD, etc is all similar to normal XP. As for users, although it doesnt get a lot of press, the embedded line is in a LOT of products, you just dont normally notice it as most OEMs put a pretty shell over the top. Kind of like the popularity of CE.

    Regards,
    Tom


  • Page 1 of 3 123 LastLast

    Similar Threads

    1. Newbie- Saving & Restoring Environment on Excellon router
      By dk-info in forum General CAM Discussion
      Replies: 0
      Last Post: 08-24-2009, 06:56 AM
    2. Need Help!- Bobcad v22 in production environment?
      By cnczoner in forum BobCad-Cam
      Replies: 5
      Last Post: 04-18-2008, 06:23 PM
    3. What can small shops do to avoid hurting the environment?
      By InspirationTool in forum General Metalwork Discussion
      Replies: 4
      Last Post: 05-07-2007, 09:25 AM
    4. Windows XP or Windows 2000 better with Mach2
      By Beezer in forum Mach Software (ArtSoft software)
      Replies: 2
      Last Post: 10-18-2004, 11:08 AM
    5. Creating a Dos Environment Via Partition Magic?
      By paulried in forum Computers and Networking
      Replies: 21
      Last Post: 05-10-2004, 10:20 PM

    Tags for this Thread

    Posting Permissions


     


    About CNCzone.com

      We are the largest and most active discussion forum from DIY CNC Machines to the Cad/Cam software to run them. The site is 100% free to join and use, so join today!

    Follow us on

    Facebook Dribbble RSS Feed


    Search Engine Friendly URLs by vBSEO ©2011, Crawlability, Inc.