Windows 8 and 8.1 Forums


NETSH commands not working from batch file

  1. #11


    Posts : 68
    Windows 8


    I already did that. My original command works perfect if I manually enter it in the prompt, but as soon as I take that exact command and paste into a batch file, it all goes south.

      My System SpecsSystem Spec

  2. #12


    Sloe Deth, Californicatia
    Posts : 3,908
    Windows 8 Pro with Media Center/Windows 7


    And you are running it elevated? I guess something happens when it's in a batch file. Try putting it into a command script or a macro
      My System SpecsSystem Spec

  3. #13


    Posts : 68
    Windows 8


    I tried command script too. No difference.
      My System SpecsSystem Spec

  4. #14


    Sloe Deth, Californicatia
    Posts : 3,908
    Windows 8 Pro with Media Center/Windows 7


    There Is probably a specific context when using in a script of a BAT file:

    Netsh: Scripting

    Also, the name you set has to match the name that is already there:

    Netsh commands for Interface IP: TCP/IP; Scripting

    Read through that, see if there is anything in it that helps
      My System SpecsSystem Spec

  5. #15


    Posts : 68
    Windows 8


    The first link is "content not found" and the second one I've read a couple of times already. It does not seem to help.

    Oh well. I guess we'll never know why this won't work.
      My System SpecsSystem Spec

  6. #16


    Sloe Deth, Californicatia
    Posts : 3,908
    Windows 8 Pro with Media Center/Windows 7


    Maybe it is the equal sign in there, try taking it out:

    netsh - Scripts to change IP settings

    This article gets into some good detail:

    Build Your Skills: NETSH scripts add network functionality to batch files - TechRepublic
      My System SpecsSystem Spec

  7. #17


    Posts : 68
    Windows 8


    Your final link seem very helpful. I've tried some of the suggestions, but still it won't work. I guess my basic NETSH skills are very limited...
      My System SpecsSystem Spec

  8. #18


    Sloe Deth, Californicatia
    Posts : 3,908
    Windows 8 Pro with Media Center/Windows 7


    Well you and me both, I just don't get it. Mainly, it says that "set name" can't set any name that's not already set. Which defeats the purpose of using the command. :/ :\
      My System SpecsSystem Spec

  9. #19


    Posts : 68
    Windows 8


    Hmm. Funny thing - I found a program that does what I want. I can even export the commands it uses to a command file, but even doing it that way, a command or batch does simply not work.
      My System SpecsSystem Spec

  10. #20


    Sloe Deth, Californicatia
    Posts : 3,908
    Windows 8 Pro with Media Center/Windows 7


    Which program? So, it works, but when exporting the commands it uses, they DON'T work?
      My System SpecsSystem Spec

Page 2 of 3 FirstFirst 123 LastLast
NETSH commands not working from batch file
Related Threads
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...
netsh issue in Network & Sharing
I'm running windows 8.1. I'm using netsh hostednetwork to allow my Android to pick up wifi. after a period of time, I can no longer access the net. Everything seems to be the same windows-wise, nothing changed that I can tell, so I'm not sure if this is a windows or Android issue. Droid still shows...
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...
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