Windows 8 and 8.1 Forums

creating scripts

  1. #1


    Göteborg
    Posts : 78
    Windows 8.1 Pro Update 1

    creating scripts


    how can you create a script to open cmd and run 'ipconfig /flushdns' at the click of a button?

      My System SpecsSystem Spec

  2. #2


    UK
    Posts : 333
    Windows Server 2012 R2 / 8.1


    Hi Jamos,

    Hope all is well!

    A simple way to do this would be bring up notepad application:

    Type in:
    Code:
    Ipconfig /flushdns

    Then go File > save as > drop "Save as type" to "all Files"

    then in filename type for example "Flushdns.bat"


    You just need to make sure it runs as a BAT file.


    If you want to stop the cmd window from disappearing after the command has ran you can use this:

    Code:
    Ipconfig /flushdns
    
    pause

    An example of this:

    Click image for larger version

    then running the BAT file:

    Click image for larger version


    If you want it to be a PowerShell script then you can run use ".ps1" file extension.

    Hope that helps!

    Cheers,
    Harry
      My System SpecsSystem Spec

creating scripts
Related Threads
creating a boot up dvd in General Support
new laptop during set up was not asked to create a boot up dvd, had a hunt around the control panel and the internet. Just cannot remember how to do it, can some one remind me please. w8.1 pre installed no disc supplied.
Creating Applications in Software and Apps
I've searched the internet extensively for information on how to create an app for my windows 8 computer, but haven't found diddly squat. I see self-made apps in the store, but none of them are what I'm looking for so I decided to try and make my own. It's purely informational, with lists and links...
Hi folks, wondering if anyone here can help me out. I have a script which runs when connecting to our vpn however it fails to set routes due to the lack of elevated permissions. When UAC is completely disabled (using the registry) the script works perfectly however certain windows 8 features...
W8 start up scripts anyone in Installation & Setup
Hi there I don't want to use a 3rd party application - but it would seem to me if one could start ANY standard application immediately a user logs in then you'd get to the desktop immediately on boot without relying on Start8 or any of these other work arounds. You could start say a "Dummy"...
Creating bat File in Network & Sharing
Hello users! I am using the following code in a .bat file to end remote desktop connection upon running the file: @%windir%\System32\tscon.exe 0 /dest:console @%windir%\System32\tscon.exe 1 /dest:console @%windir%\System32\tscon.exe 2 /dest:console @%windir%\System32\tscon.exe 2...
Windows 8 "Breaks" GPO Startup/Login Scripts in Performance & Maintenance
GPO startup scripts (for basic administrator accounts without a password) which used to work on Windows 7 don't work on Windows 8. From what I have seen and read, such scripts no longer run with elevated privileges by default. I would appreciate some suggestions on running these scripts...
Eight Forums Android App Eight Forums IOS App Follow us on Facebook