1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Auto run cmd?

Discussion in 'Windows - General discussion' started by mrcapdown, Jun 16, 2009.

  1. mrcapdown

    mrcapdown Regular member

    Joined:
    Jun 4, 2006
    Messages:
    475
    Likes Received:
    3
    Trophy Points:
    28
    I’m have a little trouble with a dns chche build up on a few work severs I know how to clear this manually but I don't want to be clearing it every morning for the rest of my life. so what I want to do it auto run this command line under task scheld ipconfig /flushdns so it will run at 9 am every morning, now how would I go about this?
     
  2. silk42

    silk42 Regular member

    Joined:
    Dec 21, 2007
    Messages:
    591
    Likes Received:
    0
    Trophy Points:
    26
    You need to create a batch file and then use the task scheduler to run the batch file every morning.

    Perform the following to create the batch file. Click on start, then select run, then type "notepad.exe". Next type the following.

    cd c:\
    ipconfig /flushdns

    Then select file, save as and save it with a name that you like with the extension ".bat". You'll need to change the file type from .txt to all files. Once you have the batch file created, you can then schedule it to run using the task scheduler in Windows.

    Click on Start, then programs, then accessories, then system tools, and finally select Scheduled Tasks. From here you will select Add Scheduled Task, select next, and then click on browse and choose the .bat file that you just created. Next choose the schedule and permissions that you want to use and you're good to go.
     
  3. mrcapdown

    mrcapdown Regular member

    Joined:
    Jun 4, 2006
    Messages:
    475
    Likes Received:
    3
    Trophy Points:
    28
    i done it now but i had to use the command dnscmd /clearcache as it was for a server i just need to test it thanks anyway.
     
  4. d4rkn1ght

    d4rkn1ght Member

    Joined:
    Jan 14, 2009
    Messages:
    66
    Likes Received:
    0
    Trophy Points:
    16
    Hi Mrcapdown

    You can also turn off dns caching...

    Click on Start, Run, and type in services.msc. Scroll to DNS Client, and then right click on it, click on Properties, and set Startup Type to Manual.

    Of course, you can turn it off in the registry, but this is much easier!

    Best Regards :D
     
  5. mrcapdown

    mrcapdown Regular member

    Joined:
    Jun 4, 2006
    Messages:
    475
    Likes Received:
    3
    Trophy Points:
    28
    hi guys
    i figered out away to do it in the end
    i made a batch file with the command dnscmd \clearcache and run it with task scheldula at 9am every moring and it seems to works fine

    thanx for the help tho
     

Share This Page