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: Issues running .bat files

27 Mar 2012   #1

Windows 7 x64 Professional

I am having a lot of difficulty running batch files. I simply want to create a runonce logon script that will install my .reg file I have created for every user who creates an account on this computer. My file is called c:\tweaks.reg. The file works fine when I double click it or run from command line using regedit /s c:\tweaks.reg.
When I enter this into a batch file to link to my run once script, it does not work.
The problem is command prompt appears and disappears instantly without executing the .reg file.
@echo off
regedit /s c:\tweaks.reg

What am I doing wrong? This is happening on both of my Windows 7 systems and one is a fresh installation. Thanks in advance!

I should note the .bat file is not working running it alone (before putting it into the run once script) so this is not an error in the .reg or the run once script.

My System SpecsSystem Spec
27 Mar 2012   #2
Microsoft MVP

Windows 7 Ultimate 32bit SP1

Have you saved the .bat file to notepad? Have you right clicked it and chosen to run as Administrator?
My System SpecsSystem Spec
27 Mar 2012   #3

64-bit Windows 10 Pro

Hello Jlevitt, and welcome to Seven Forums.

You could also change the registry settings directly with the batch file instead of trying to run the REG file with the batch file.

You could type reg add /? in a commmand prompt to see the full usage.

Reg Add "reg-key" /v ValueName /t TypeOfValue /d DataForValue /f

If you like, you can edit the BAT files in OPTION THREE of the tutorial below as an example to help.

Taskbar - Lock or Unlock in Windows 8 - Windows 8 Forums

Hope this helps,
My System SpecsSystem Spec

27 Mar 2012   #4

Windows 7 x64 Professional

Thank you for your response. Yes I saved it as a .bat file after creating it in notepad. I have tried running it as administrator as well to no avail. I have noticed that even trying something as simple as opening cmd.exe with a .bat file does not work either. It pops up briefly and disappears instantly. Example:
@echo off

I would have to assume there is something set in windows that is preventing execution of a .bat file. This computer is not part of a domain and it was a fresh install. Any ideas?
My System SpecsSystem Spec
27 Mar 2012   #5

Windows 7 x64 Professional


Thanks for your response but the issue seems to be that I am unable to execute anything. I have tried your suggestion as well. I have even copied examples of registry commands from other forums to test. The commands work fine if run from cmd.exe, but they do not work from a .bat file.
My System SpecsSystem Spec

 Issues running .bat files

Thread Tools

Similar help and support threads
Thread Forum
BSOD issues running WoW gotten worse.
At first it seemed my girlfriends computer would only BSOD when she was playing World of Warcraft, but after 3-4 times of her taking it to the staples where she purchased it, I've decided to just come here. She was going to buy a whole set of crap that I really don't think her computer needs/...
BSOD Help and Support
Issues running with USBview ?
Hi. I run Windows 7 Ultimate 32bit here. I would like to have USBview to run, but when I try, the timeglass comes up, and shortly after it stops running, and no more happens. I have tried to run USBview also as admin, but that dind't helped. Any suggestions please, thanks!
Hardware & Devices
Need help - boot issues and general running
Hi, I'm pretty much a novice so I don't really know what is going on. I have an Advent Roma 2000, when I try to start it up the initial loading screen comes up but then after about 4/5 seconds of doing nothing it loses power, cuts out and restarts pretty much immediately. If I press f12 on...
General Discussion
Issues with game resolution after running on VGA out.
I recently began to use my VGA out on my laptop, as I found I had a spare VGA cable and our 40" TV in the living room supports it. I decided to make use of it, and hitched up my laptop, and used it for mostly gaming. I've found, however, that now that my laptop is not running on the television, if...
Gigatribe running issues
Hello i am having trouble getting gigatribe 2.52 to run in windows 7 sometimes it loads just fine other times it doesnt load at all or hang when running. I have tried running the program in compablitity mode with no luck with would love some help with this issue. Program is designed to run on port...

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:01.
Twitter Facebook Google+