Windows 8 and 8.1 Forums


Running batch File in Windows 8.1

  1. #1


    New Zealand
    Posts : 4
    Windows 8.1

    Running batch File in Windows 8.1


    I accidentally set the file open of .bat files to Notepad. From a link in this forum (How to Restore Default File Extension Type Associations in Windows 8 and 8.1)was able to reset the registry back I think. The bat file not longer asks for notepad but instead opens "How do you want to open this file" and ask me to look for an app. The batch files still do not run.

    Any help gladly accepted.

      My System SpecsSystem Spec

  2. #2


    Hi and Welcome to EightForums,

    In a command prompt


    Restore the default file type association.
    Type 'assoc .bat'
    It should return with
    ..bat=batfile

    If not

    Type 'assoc .bat=batfile'

    Restore the default "Open" action for the file type.
    Type 'ftype batfile'
    should return with
    batfile="%1" %*

    If not

    Type 'ftype batfile="%1" %*'

    See if this helps.

    Cheers,
    Jamie
      My System SpecsSystem Spec

  3. #3


    or ... Default File Associations - Restore in Windows 8

    Scroll down to .bat and follow instructions.
      My System SpecsSystem Spec

  4. #4


    New Zealand
    Posts : 4
    Windows 8.1

    Still not working


    Hi
    Still not working.

    JDobbsy1987
    I have reset the system as per the assoc and ftype command and get the results you indicate but it still is looking for an app and does not run batch files.

    Ztruker
    Using the registry reset as per your link resets the values but I still get the same result.

    The system I am running is a Surface Pro 2 running Windows 8.1. I have compared the settings with a Surface Pro 3 - the registry values are identical that I can see but I still get the issue. The Surface Pro 3 runs batch files fine

    Comparing the setting with my Dell laptop (Precision M6700 running Windows 7) the registry settings look to be the same.

    One difference though between the Surface pro 2 and the other two systems:

    On my Surface Pro 2, when I look for the file associations (Default Programs, Set Associations, the description says "BAT File" and then unknown application. On the Surface 3 and the Dell, the description says "Windows Batch File" rather than "BAT File". Any ideas on how to change this in the Surface Pro 2?

    Anyway, thank you both for your input.
      My System SpecsSystem Spec

  5. #5


    Harrisonburg, Va.
    Posts : 10,488
    Windows 8.1.1 Pro with Media Center


    Try running this batch file---

    Repair.bat

    Download it, right click it & choose Properties & unblock it & right click it again & choose Run as Administrator.

    It runs sfc & dism commands.

    Report back with results please,
      My System SpecsSystem Spec

  6. #6


    New Zealand
    Posts : 4
    Windows 8.1


    Hi David

    Ran the process - could not file any unblock option within properties but downloaded your batch into my user downloads library.

    Opened a command prompt as Administrator, ran the batch file, process completed successfully, took a while, but no change - issue still there, running batch files still asks for app.

    The batch file will run within a command prompt but not from the desktop shell.

    Thanks for the input but any other ideas?
      My System SpecsSystem Spec

  7. #7


    What about doing a System Restore to before you made the change.
      My System SpecsSystem Spec

  8. #8


    New Zealand
    Posts : 4
    Windows 8.1


    Hi All

    Thanks for all your input. In the end I refreshed the Windows 8.1 in the Surface and batch files now run. The metro Apps restored themselves but the desktop app had to be restored. (I was running Autocad, Revit and Max Design on the Surface) so took a bit of time.

    Thanks again

    Cadtot
      My System SpecsSystem Spec

  9. #9


    Harrisonburg, Va.
    Posts : 10,488
    Windows 8.1.1 Pro with Media Center


    Glad you got it fixed.
      My System SpecsSystem Spec

Running batch File in Windows 8.1
Related Threads
I'm trying to create a NETSH batch file that sets my TCP/IP settings to DHCP. The line I want to use is: netsh interface ipv4 set address name="My Custom Named Network" dhcp If I run the global cmd prompt and paste this line, it works as intended. However, if I create a batch file with the...
Need Batch File Help in General Support
First off, sorry if this is not posted in the right forum. I wasn't sure if it was more appropriate here or in the "Chillout Room" or elsewhere. I'm a noob when it comes to batch scripts, so I'd appreciate any help I could get. I tried doing all sorts of searches to find my answer (at least one...
Good day, my first visit here. I have a Lenovo laptop running Windows 8.1. I run a number of VB6 programs. One is an estimating system that makes use of .dat files. When I first install the program and the files, everything works fine. The problem comes when I 'over-write' a .dat file with a...
I need a way to play a video constantly all day, I found the following batch file which when edited for my video works perfectly in both Chrome and Firefox but does not work in Internet explorer(IE) Does any one have a solution for IE please. The Batch file is as follows:- <!DOCTYPE html> <html>...
If anyone is interested, I made a tutorial on using a batch file to run dism & sfc. https://www.eightforums.com/windows-updates-activation/40095-windows-update-wont-download-sfc-finds-corrupt-cant-fix-2.html#post336782 I hope it is useful to someone. :)
Solved Batch file question in General Support
Hi, I'm writing a small batch file, but it doesn't show everything. Can you help? @echo offsetLocal EnableDelayedExpansion pushd "C:\Users\%username%\Desktop" type nul > "%hostname% %username%" I also want to add IP-address (and maybe leave the username out).
Since Windows 8 is not creating System Restore points, apparently because I have a dual boot Windows 8 / Windows 7 setup, I'd like to schedule one every 3-4 days or so. Is there any way to run system restore from Command line or batch file or Powershell? If so then I could schedule it to run...
Eight Forums Android App Eight Forums IOS App Follow us on Facebook