BleepingComputer.com: Auto Program Needed

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Auto Program Needed Need a program to carry out fixed operations on my PC automatically

#1 User is offline   1up2down 

  • Forum Regular
  • PipPipPip
  • Find Topics
  • Group: Members
  • Posts: 220
  • Joined: 23-June 04

Posted 08 November 2010 - 08:08 AM

I am looking for a program that will carry out fixed operations on my computer automatically. For instance, when I turn off the computer, I need it to copy certain files and folders from my C drive to my backup drive. Then when I turn the computer on again, I need it to copy them back again. Can anyone tell me if there are any such programs available.

I would be grateful for any help this group can give me, thank you.

#2 User is offline   groovicus 

  • Hail Groovicus!
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Moderator
  • Posts: 9,605
  • Joined: 05-June 04
  • Gender:Male
  • Location:Centerville, SD

Posted 08 November 2010 - 11:28 AM

You can do it yourself:
http://www.windows-help-central.com/windows-shutdown-script.html
"Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdom will come to you that way" - Christopher Hitchens

#3 User is offline   1up2down 

  • Forum Regular
  • PipPipPip
  • Find Topics
  • Group: Members
  • Posts: 220
  • Joined: 23-June 04

Posted 08 November 2010 - 12:35 PM

Looks complicated but I will give it a try Thanks

#4 User is offline   groovicus 

  • Hail Groovicus!
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Moderator
  • Posts: 9,605
  • Joined: 05-June 04
  • Gender:Male
  • Location:Centerville, SD

Posted 08 November 2010 - 01:04 PM

Not really complicated. There are tons of examples of scripts to do just what you want. All you need to do is add them in the appropriate places. I don't know of any software that will specifically do what you want.
"Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdom will come to you that way" - Christopher Hitchens

#5 User is offline   1up2down 

  • Forum Regular
  • PipPipPip
  • Find Topics
  • Group: Members
  • Posts: 220
  • Joined: 23-June 04

Posted 08 November 2010 - 06:49 PM

It may not seem complicated to you but it does to me. I can't even see how to get started. I think what I need is someone to talk me through the process for first time.

#6 User is offline   groovicus 

  • Hail Groovicus!
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Moderator
  • Posts: 9,605
  • Joined: 05-June 04
  • Gender:Male
  • Location:Centerville, SD

Posted 09 November 2010 - 10:00 AM

Sorry, I wasn't trying to be flip about it. All you literally need to do is search the web for a script that will copy files, alter the script slightly to use your file names and locations. Then use the instructions I linked to to run the script on shutdown. Then you need to alter the script to move files on startup using the same instructions.

So for example:
Const OverwriteExisting = True
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "C:\FSO\ScriptLog.txt" , "D:\Archive\", OverwriteExisting

becomes:
Const OverwriteExisting = True
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "<location of file>" , "<location to save file>", OverwriteExisting

Just put in the path names.

All the scripts you should need are here:
http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/filesfolders/files/

So in order to teach yourself how to do this, you create a test script that moves a single file from one place to another, and set it to run on shutdown. Reboot your computer and see if it worked.

EDIT: This example uses VBScripts to accomplish what you want, but you certainly could use batch files, shell scripts, etc.

This post has been edited by groovicus: 09 November 2010 - 10:39 AM
Reason for edit: clarification

"Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdom will come to you that way" - Christopher Hitchens

#7 User is offline   1up2down 

  • Forum Regular
  • PipPipPip
  • Find Topics
  • Group: Members
  • Posts: 220
  • Joined: 23-June 04

Posted 09 November 2010 - 03:28 PM

It still seems complicated to me, almost like writing a program, and when it comes to that I'm a complete novice.

First of all I need to overcome the first hurdle, where do I write the script. Looking at information online it appears I have to open a notepad and write the script in that. Then it says I have to write it's name and extension - .bat with the option Save as: All files.

Am I right so far?

#8 User is offline   groovicus 

  • Hail Groovicus!
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Moderator
  • Posts: 9,605
  • Joined: 05-June 04
  • Gender:Male
  • Location:Centerville, SD

Posted 09 November 2010 - 04:47 PM

Mostly. If you want to use a .bat file, then you use the extension .bat; a VBScript file uses a .vbs extension. Here is an example you can try:

Quote

Start up Notepad. Enter this text:
MsgBox "Hello World!"
Save it as "HelloWorld.vbs" (Or any name with a .vbs extension. You need to save it with the quotes if you are using the default Windows behavior of hiding file extensions). Open up Explorer, find the file you just saved, and double-click it. Yes, it's that easy.

Try another simple one: Again start up Notepad, but enter this text:
strMyName = InputBox ("Enter your name")
MsgBox strMyName & " is my master!"
Again, save it (any name with a .vbs extension) and double-click it. Easy.


Source

Quote

It still seems complicated to me, almost like writing a program, and when it comes to that I'm a complete novice.

It is programming, but fortunately there are so many examples freely available that you do not need to reinvent the wheel. You just need to put parts and pieces together with minor modifications.
"Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdom will come to you that way" - Christopher Hitchens

#9 User is offline   1up2down 

  • Forum Regular
  • PipPipPip
  • Find Topics
  • Group: Members
  • Posts: 220
  • Joined: 23-June 04

Posted 09 November 2010 - 05:31 PM

Thanks. Now you are talking my language. I will give that a try and let you know how it goes tomorrow.

#10 User is offline   1up2down 

  • Forum Regular
  • PipPipPip
  • Find Topics
  • Group: Members
  • Posts: 220
  • Joined: 23-June 04

Posted 09 November 2010 - 06:05 PM

The first one "Hello World" was easy a worked a treat, but with the second

strMyName = InputBox "Tony" MsgBox strMyName & " is my master!"

I got an error message saying

Script: C:\Documents and Settings\Tony\Desktop\Tony.vbs
Line: 1
Char: 22
Error: Expected end of statement
Code: 800A0401
Source: Microsoft VBScript compilation error

Still, I am happy. At least I got over that first hurdle and know how begin writing scripts. Now other scripts will begin to make sense, even to a PC dummy like me. Thanks to your help.

#11 User is offline   1up2down 

  • Forum Regular
  • PipPipPip
  • Find Topics
  • Group: Members
  • Posts: 220
  • Joined: 23-June 04

Posted 09 November 2010 - 06:12 PM

Tried it again removing the quotes in the middle of the message and it worked, no error message. It produced a copy of the notepad with the same message in it.

strMyName = InputBox "Tony MsgBox strMyName & is my master!"

#12 User is offline   Romeo29 

  • Learning To Bleep
  • PipPipPipPipPipPip
  • Find Topics
  • Group: BC Advisor
  • Posts: 2,834
  • Joined: 06-July 08
  • Gender:Not Telling
  • Location:127.0.0.1

Posted 09 November 2010 - 08:08 PM

Actually, it does not have to be VBScript or JScript script file. You can also use a command script (batch file) file.
See here : http://www.trishtech.com/win7/run_a_script_at_shutdown_in_windows_7.php
Also : http://www.windows-help-central.com/windows-shutdown-script.html

This post has been edited by Romeo29: 09 November 2010 - 08:09 PM


#13 User is offline   groovicus 

  • Hail Groovicus!
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Moderator
  • Posts: 9,605
  • Joined: 05-June 04
  • Gender:Male
  • Location:Centerville, SD

Posted 09 November 2010 - 08:10 PM

Sometimes when you do copy and paste, things like quotation marks do not translate well. In many instances, websites will sanitize quotation marks for double quote marks (easiest way to explain) to prevent things like script injection, etc.

Sounds like you are off and running!
"Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdom will come to you that way" - Christopher Hitchens

#14 User is offline   1up2down 

  • Forum Regular
  • PipPipPip
  • Find Topics
  • Group: Members
  • Posts: 220
  • Joined: 23-June 04

Posted 10 November 2010 - 02:33 PM

View Postgroovicus, on 09 November 2010 - 08:10 PM, said:

Sometimes when you do copy and paste, things like quotation marks do not translate well. In many instances, websites will sanitize quotation marks for double quote marks (easiest way to explain) to prevent things like script injection, etc.

Sounds like you are off and running!


Yes, you've got me started on something I think I am really going to enjoy doing in the future. Obviously there is a lot to learn yet, but I will play safe by only practising with new scripts when I have my Returnil program is switched on just in case I do something really silly.

I realised later that the reason the second script didn't work properly was because I did not save the notepad with quotes like you showed me to. I'm very grateful for you suggesting script to me and only wish I had known about it years ago.

Thanks again

#15 User is offline   1up2down 

  • Forum Regular
  • PipPipPip
  • Find Topics
  • Group: Members
  • Posts: 220
  • Joined: 23-June 04

Posted 10 November 2010 - 02:35 PM

View PostRomeo29, on 09 November 2010 - 08:08 PM, said:

Actually, it does not have to be VBScript or JScript script file. You can also use a command script (batch file) file.
See here : http://www.trishtech.com/win7/run_a_script_at_shutdown_in_windows_7.php
Also : http://www.windows-help-central.com/windows-shutdown-script.html


Thanks, I like that first link you gave me, that's just what I was looking for.

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users