Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: .bat reg import gives error accessing the registry

28 Jan 2014   #1
aVco

Windows 7 Ultimate x64
 
 
.bat reg import gives error accessing the registry

Hello everyone, im new here!
now, ive got a .reg file that id like to import automatically via .bat file to the registry.
if i type the code myself in CMD it does work, but the same code via the .bat file refuses to add and
get the error of: error accessing the registry

im using the code : reg import *****.reg

does anybody knows what seems to be the problem?

thanks!


My System SpecsSystem Spec
.
28 Jan 2014   #2
UsernameIssues

W7 Pro SP1 64bit
 
 

Welcome to the Seven Forums.

The batch file will need to be run with elevated privileges.
Elevated Command Prompt
My System SpecsSystem Spec
28 Jan 2014   #3
aVco

Windows 7 Ultimate x64
 
 

thank you!

i had thought of that and it still isnt working. nevertheless, the .bat file is meant to start automatically as a part of startup program

is there any other idea?

thank you for trying though!
My System SpecsSystem Spec
.

28 Jan 2014   #4
UsernameIssues

W7 Pro SP1 64bit
 
 

I don't know of a way to do that.

Having an executable (the batch file) automatically elevate its privileges (without user interaction) seems to be something that a virus would like to do - so, I think that the W7 operating system security model prevents that from happening.
My System SpecsSystem Spec
28 Jan 2014   #5
Kaktussoft

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
 
 

Quote   Quote: Originally Posted by UsernameIssues View Post
I don't know of a way to do that.

Having an executable (the batch file) automatically elevate its privileges (without user interaction) seems to be something that a virus would like to do - so, I think that the W7 operating system security model prevents that from happening.
Post the bat file please. I can't understand why you want to modify registry on each startup.
What do you mean by running it "on startup"? On system startup or on windows logon?
My System SpecsSystem Spec
28 Jan 2014   #6
andrew129260

Windows 10 Pro
 
 

You cannot make a command prompt auto elevate itself (that would be bad for many reasons), but you can make it prompt/ask for it, which is a one click yes on the yes button for UAC.
(If you are an admin, otherwise standard users would be prompted for admin credentials.)

See this code attached and add it to the beginning of the batch file.

However, if you run the bat file through group policy at login script or by way of the task scheduler at login, you could bypass UAC and run it regardless of the users settings being admin or standard user.


Attached Files
File Type: txt ask for admin rights.txt (748 Bytes, 31 views)
My System SpecsSystem Spec
29 Jan 2014   #7
aVco

Windows 7 Ultimate x64
 
 

Quote   Quote: Originally Posted by Kaktussoft View Post
I can't understand why you want to modify registry on each startup.
What do you mean by running it "on startup"? On system startup or on windows logon?
not on every startup. i would like to have it run when i choose to by starting another program that also execute the batch file and add something to the registry.
its of no concern though, even when im trying to REG ADD through the .bat it gives me an error

Quote   Quote: Originally Posted by andrew129260 View Post
if you run the bat file through group policy at login script or by way of the task scheduler at login, you could bypass UAC and run it regardless of the users settings being admin or standard user.
thank you for trying to help!
i have downloaded the txt and added it to the batch file and its still gives me the accessing registry error.

whats that about the group policy?
btw, i am the admin of this machine.

i have tried to make it cumbersome a little bit, thinking it would bypass the problem by using the command "start" and then having to click Yes in order for it to be added to the registry, but it still gives me the same error unfortunately
My System SpecsSystem Spec
29 Jan 2014   #8
UsernameIssues

W7 Pro SP1 64bit
 
 

Quote   Quote: Originally Posted by aVco View Post
~~~
i would like to have it run when i choose to by starting another program that also execute the batch file and add something to the registry.
~~~
Something like this could be used to get around tracking the trial period for software.

We will need details...
What program are you talking about?
What info needs to be changed in the registry?
Does the info need to be changed before the program starts?

...before we can continue to help.
My System SpecsSystem Spec
29 Jan 2014   #9
aVco

Windows 7 Ultimate x64
 
 

Quote   Quote: Originally Posted by UsernameIssues View Post
We will need details...
What program are you talking about?
What info needs to be changed in the registry?
Does the info need to be changed before the program starts?

...before we can continue to help.
well, there is a way to enter safemode within msconfig and so id like to be able to run
a batch file after marking the V, that will disable that option from within the registry right after
i get into the safemode.
theres no info needs to be changed, only added

if any more information is needed, please ask

i didnt explain it before because it sounds a bit complicated, but still after everything i have tried the
problem remains when i try to add or import.
My System SpecsSystem Spec
29 Jan 2014   #10
UsernameIssues

W7 Pro SP1 64bit
 
 

My guess is that you are seeing ERROR: Error accessing the registry because your account does not have permissions to change that part of the registry. What registry key are you working under?
My System SpecsSystem Spec
Reply

 .bat reg import gives error accessing the registry




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Unable to import <filename>.reg: Acces to the registry denied
Hello, This is a pretty long story...: So, I have program called CCleaner, it is a fine tool which can clean up your browser cookies, temporary files, etc. It can also scan for errors in the registry and remove them, however, this is not always safe, so I always make a backup whenever I mess...
Performance & Maintenance
Windows won't load after failed registry backup-Import
Hello, I tried to import an entire registry backup, I received an error message similar to this one:" Error accessing the registry.". then, Via "regedit" I tried to give permissions to my WinUser, (giving full control ). I still received the same message, so I restarted my pc,And now...
General Discussion
Error Accessing the Registry in regedit.
Running .reg file gives this error. In Regedit I also cannot create a new key (to add the contents of the .reg file manually.) I have Full Control in permissions for HKEY_USERS.
General Discussion
Can t import registry from a x32 application to my x64 OS
Hi all this is my first post in the forum.I have windows 7 professional x64.I am using an application called smart install maker Smart Install Maker - Custom setup files made easy.This software generally creates setups (i make exe files).It s a x32 application.I create setups where i copy some...
Software
Error accessing the registry
Hi all and merry hollidays. I got a problem you may be able to help me... Yesterday I did a fresh installation of my W7 professional. Before that I backup the things I know I need. One ot them was to backup a branch from the registry to keep some details for a program I have. Today I...
Installation & Setup
Is there any way to tell who is accessing the registry?
Log Name: Application Source: Microsoft-Windows-User Profiles Service Date: 8/26/2009 6:00:03 AM Event ID: 1530 Task Category: None Level: Warning Keywords: User: SYSTEM Computer: Home01 Description:
General Discussion


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 09:46.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App