Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 


Sign in to follow this  
Bills Gate

How to call a .reg file from a .reg file ?

Recommended Posts

Hi guys, Im new here and Im trying to make my first unatteneded..

I know this a dumb question, but how do I call one reg file from another reg file ?

I know how to call a batch from within a batch, but I just don't know what code to use to call a reg file from a reg file...

I have two registry files, one called tweaks.reg and one called runonce.reg, I want to keep this layout for clarity of editing...

What code do I need to add to the end of the 'tweaks.reg' to get it to call the 'runonce.reg' after it ?

Both files are located in the same folder.

and before you all start shouting to search the forum, I DID, but I get a 'page cannot be displayed' error when I search for ANYTHING on this forum, so I assume the search is broken or something, I get the 'your search has been completed please wait while we transfer you' screen, but then I get the error of page can't be displayed, it doesn't matter what I search for, can someone tell me if the search is working ok here at the moment ? I never had problems before...

Thanks for any info on this simple question... and sorry to be asking dumb questions...

TYVM

Share this post


Link to post
Share on other sites

in your .cmd/.bat file, why not just put this

REGEDIT /S file1.reg

REGEDIT /S file2.reg

replace filenames with your own

or u can add an entry in "RunOnce" in registry 2 run file #2 when the pc starts up again (but that defeats the purpose of unattended really) so suggestion #1 is best :)

HTH

Share this post


Link to post
Share on other sites

Hmmm, that doesn't help Im afraid, but thanks lots for the prompt post !!!!

My reasons for needing this particular line of code are very very specific.

Without going in to an over elaborate explanation, I must be able to call the runonce.reg file from the last line of the tweaks.reg and need to know the line of code I would use to do that, given they are in the same folder..

At the moment the two files are infact one big long file which does run fine, but for clarity of editing I would prefer to use two files and call the second one from the end of the first one...

Can anyone tell me what code I need to use to achive this ?

Alternatives and work arounds are of no use to me.

Thanks guy's..

Bill

Share this post


Link to post
Share on other sites

why don't you just call them seperately? it would have the same effect.

by the way, you can't call a registry file from with a registry file like a batch file can. They weren't designed that way. They were just made to to import registry settings, not to execute things. the registry file with the RunOnce keys doesn't execute the program, RunDll32 does when it see the RunOnce keys in the registry.

Share this post


Link to post
Share on other sites
Alternatives and work arounds are of no use to me.

Looks like you don't really want an answer then, because what you want to do cannot be done. Sorry...

Share this post


Link to post
Share on other sites
My reasons for needing this particular line of code are very very specific.

Without going in to an over elaborate explanation...

Well trust me, people around here deal with very specific stuff all day :)

Just tell us what the final result is you're looking for and I'm sure there's a solution.

Share this post


Link to post
Share on other sites

@ Alanoll : Yes, calling them individually would indeed be the best option, but sadly I don't have the ability to modify the code that executes the first file, it's a routine written by someone else which calls a single reg file of a pre-determined name which can not be changed or it doesn't find it. Thats the best soloution for sure, but I regret it's not an option, but thanks lots for your time and input, I did not know you couldn't call one reg file from another... darn... Sincere thanks to you !

@ jdoe : if you read my second post in this thread, you would have seen that at the moment they ARE merged together in one big long file, however for simplicity of editing just the parts I need, I would have liked to have two files, one for tweaks and one for runonce, so when I come to update this in 6 months and I can't remember what I did, it would be easier to do, I guess I just can't have it that way, no harm in asking tho, right ?

@ johann83 : If I didn't want an answer, I wouldn't have asked the question, what I did not ask for however, was your opionions on what I may or may not have needed, a simple 'thats not possible' like Alanoll was kind enough to explain, would have sufficed... I couldn't put it any more simply, how can I call one reg file from another ? Its not rocket science.. my reasons for needing that answer and not an alternative answer are not up for discussion, it was a simple enough question and a simple answer was all I was looking for...

@ ZoSTeR : Thanks for that input, I can't really be any more specific, I wanted one reg file to call the other one, but I think Alanoll has infact answered my question with a resounding 'Windows won't let you do that as it's not designed that way'... I can solve this one my self using a multitude of different methods, but none of them were exactly what I was looking for, one file calling the other was...

Sadly it can't be done as I intended, as already stated, no harm in asking tho, right ?

Thanks to all who posted, and in particular Alanoll, if an admin would be kind enough to close this thread for me, I would be grateful

Share this post


Link to post
Share on other sites

can't you edit the script?

if the script is simple, perhaps just adding another line? or if it's just a line that calls the reg file, change the entry to a batch file that then calls teh two reg files.....

Share this post


Link to post
Share on other sites

The only way I can think of doing what you want is if you had a key to the run section of either HKLM, or HKCU. Have that run a REGEDIT. That will require another restart though.

Other than that, there is no other way.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...