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
Jlevitt

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
Jacee
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
Brink

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,
Shawn
My System SpecsSystem Spec
.

27 Mar 2012   #4
Jlevitt

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
c:\windows\system32\cmd.exe

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
Jlevitt

Windows 7 x64 Professional
 
 

Brink,

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
Reply

 Issues running .bat files




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Application facing issues running on Win7
Hi, I have created a software application (created using C#.Net) on XP machine, which runs fine and good. Now when i migrate the application from XP to Win 7 enterprise machine as per the project requirement, I face following issues: ISSUES: The titles of some windows are missing. The...
Software
Running Firefox and windows 7 and having flash issues
on my computer i can view flash videos on sites such as Hulu and Youtube and Newgrounds. BUT i can't view flash on other sites. for example on southparkstudios i get the load symbol and then nothing. its just a black screen. also on adultswim(cartoonnetworks late night programming NOT porn), its a...
Browsers & Mail
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...
Gaming
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...
Software


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 08:17.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App