Simple Windows Script to Copy a File in Background??
August 19, 2006 11:10 AM
Subscribe
Anyone on MetaFilter any good at writing Windows Scripting Language (VBScript) scripts? I am a total nonprogrammer but need a simple task done, which is copying a file from one directory to another (on a Win XP) system either (a) every twenty minutes, or better still (b) after checking to see if the archive bit on the file has been reset, indicating that it has been changed since the last filecopy. This should run as a background script without any user intervention or evidence that it is happening, if possible.
Here's the problem in more detail, which relates to combining randomized desktop wallpaper and a dual-monitor setup.
. The program "Wallchanger" changes the desktop wallpaper at a preset interval (I have it set for every 20 minutes), choosing randomly from a collection of graphics, and writing the newly chosen file to "c:\windows\wallchanger wallpaper.bmp."
Several months ago I switched to a dual monitor setup. I use the fantastic utility Ultramon to control various aspects of the two-monitor setup. One of the things Ultramon can do is stretch a single wallpaper across the two desktops, but it has to be a static file in the location "c:\documents and settings\
\my documents\my wallpapers." Since I have been unable to get Ultramon to recognize and use my wallchanger wallpapers, I currently have the same wallpaper, twice, side by side on the two monitors.
I know many of you purists willl probably answer that I should just ditch wallpapers and go with a plain desktop background, but I really love my collection of astronomical and aurora photographs, and I am dying to stretch my wallpapers across the two monitors...
The paths of the files are not configurable options in either wallchanger or ultramon, so I figure I have to take the file wallchanger creates in c:\windows every 20 min and copy it to the proper location for ultramon to find it. I figure that, for someone who knows scripting, this would be a trivial thing to bang out. Am I right? I have tried to read online tutorials/introductions to windows scripting but I cannot get further than the point where they show you how to write "Hello World!" to your screen. I would appreciate any help with this.
posted by emg to computers & internet (3 comments total)
1. Open a DOS prompt. Experiment with the copy command until you get the parameters correct.
2. Open Notepad. Put the correct copy command in the text file. Save the file as a *.bat file, something like copy_wallpaper.bat.
3. Use the Windows Task Scheduler to schedule the program copy_wallpaper.bat to run every 20 minutes. When first prompted, say that you want the task to run daily. In the Advanced properties window, you can set the task to run every 20 minutes.
posted by crazycanuck at 11:20 AM on August 19, 2006