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: A way to edit Notepad files with Task Scheduler?

13 Feb 2014   #1

Windows 7 64 Bit
A way to edit Notepad files with Task Scheduler?

I need a way to change a Notepad file with Task Scheduler, or anyway really.
Heres an example:

I edit a Notepad file, and save it.
At 1 PM I want the Notepad file to automatically change to what I want.
So when I open that Notepad file after 1 PM, it looks the same as it did before I edited anything.

Wondering if this is possible. I heard somewhere it was, but couldn't figure out how.

I need to use this on the Host file, by the way.

Is there a batch file or something that I can schedule to run with Task Scheduler to do this?

My System SpecsSystem Spec
13 Feb 2014   #2

XP Pro (x86) | 7 HP (x86) & (x64) | 7 Pro (x64)

Hi MouseFollower :)

Notepad can open a lot of file types ... I presume you mean a TXT file ?

I have never used TaskScheduler ... BUT

Lets call the Notepad file Daily.txt

Two script files
  • condition to handle missing "Daily.txt"
  • condition comparing dates(?) (or file attributes) to avoid clearing Daily.txt before 1300hrs, if OS is rebooted before 1300hrs
  • copy contents of "Daily,txt" to a "Hold.tmp" file (overwrite "Hold.tmp")

  • overwrite "Daily.txt" with contents of "Hold.tmp"

Run "Start.vbs" at OS startup (or via Task Scheduler at a specific time)
Run "OneOclock.vbs" via Task Scheduler at 1:00pm

VBScript Forum is a good forum for script help
My System SpecsSystem Spec
14 Feb 2014   #3

Windows 7 Professional x64

The simplest way is to create a .bat file and a text file with the desired text:

copy C:\PATH\TO\source.txt C:\PATH\TO\destination.txt
Where source.txt is the fle to copy the text from and destination.txt is the file to copy the text to.
My System SpecsSystem Spec

14 Feb 2014   #4

W7 Pro SP1 64bit

Without violating the forum rules...
13) No ad blocking discussions. This site depends on ads to pay for the costs of running and maintaining it
...can you tell us more about the changes that you want to have take place in the HOSTS file? What are you attempting to accomplish?

diolemo might have given you the simplest solution, but you will probably want two source files. And the HOSTS file is in a protected folder... so you may need to run the scheduled task with the option named Run with highest privileges checked.

Let's not call the HOSTS file a "Notepad file", let's stick to calling it the HOSTS file.
My System SpecsSystem Spec

 A way to edit Notepad files with Task Scheduler?

Thread Tools

Similar help and support threads
Thread Forum
Need help creating a task scheduler task to move files over a network.
Hello everyone, I need to have a task run that will move the contents of a folder from one computer to another over my home LAN. Files get downloaded during the night on one computer and then need to be transfered to another. Usually I am doing this by hand, but then though maybe I could get...
General Discussion
Task Scheduler - Log Files, Output, etc.
Hi guys and gals, I'm trying to accomplish something at work and need some help. Here is the situation: 1) There is a scheduled task setup to run an 'import' for my companies software. This task runs a .bat file which runs a program with a few switches (application 1). I have edited the...
General Discussion
Need default Task Scheduler files
never mind
Performance & Maintenance
Making the 'edit' option on batch files open in notepad++
Hello, Tonight it seems like I have really got myself into a pickle. As the title says I tried to change the default editor for batch files. I dinked around in the registry a bit, and I now have myself this. Any suggestions to actually making it work? Thanks...
General Discussion
How to edit existing scheduler task?
The Scheduler instructions for editing and existing task say to select the task and click on Properties under Actions. Unfortunately there is no Properties under Action. What do I do?
General Discussion

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 03:35.
Twitter Facebook Google+