Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running a program automatically

Status
Not open for further replies.

EKC

Technical User
Jan 13, 2001
43
CA
Hi,

I need to run my program (exe)every morning at 7am.Is it possible to automate this?Any idea

Thanks in advance
Lyn
P.S
Doing my first VFP program I learned a lot from this forum.
Still lot to learn!
 
You could use the windows schedular...

HTH,
Weedz (Wietze Veld)
veld4663@exact.nl

They cling emotionally to code and fix development rather than choosing practices based on analytical assesments of what works best.

After the GoldRush - Steve McConnell
 
Or ... you can have your program running all of the time with the process you wish to have take place inserted into some sort of looping construct which checks for the time periodically and when it is the correct time .. do it's thing.


Don
dond@csrinc.com

 
Or have the main part of the program be a form with a Timer control on it.

I have Windows 2000 and use the Windows Scheduled Tasks to run several VFP EXEs throughout the day - seems to work just fine. Robert Bradley
Do you have too much money? Visit
 
I've got to give a third Thumbs Up for window's task scheduler. It is reliable.
-Pete
 
Considering the 3rd thumbs up ... I had never used the Windows Task Scheduler but thought I would investigate it.

I concur ... It is simple (intuitive even) to use and appears to be reliable. It opens up possibilities for scheduling all sorts of little processes during the day/week/month, etc ...


Don
dond@csrinc.com

 
It's amazing how many useful things there are in windows which are often missed by many people. For instance I always hated having to minimize all the processes I was running to get to my desktop. Then one day relatively recently, my mouse happened to land on a strange looking little icon on the bottom row and it said "show desktop". Lo and behold, there was a way to get directly to the desktop there all along! (At least in Windows '98). Now I use it all the time. I'll have to try this scheduler out. -- Dave
 
LOL Same thing happend to me 6 months ago or so! Now I use it all the time.
-Pete
 
Hey ... I just tried it (show desktop icon) ... it's great !!!
Don
dond@csrinc.com

 
If your keyboard is equipped with the windows key(typically next to the ALT key), try the following:

[Windows]+D - Show Desktop
[Windows]+F - Find Files or Folders
[Windows]+R - Run
[Windows]+E - Windows Explorer
[Windows]+F1 - Windows Help

Try this:
Right-click the start menu and select open. In the subsequent window, select File>New>Folder. Rename the folder the following:
Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}

(Do a copy -n- paste because it has to appear exactly as shown above). Close the window and click your start button. Pretty cool, huh. Jon Hawkins

The World Is Headed For Mutiny,
When All We Want Is Unity. - Creed
 
Thanks Jon for your tips, very helpful.

It's funny, but I avoid using Desktop at all costs because of the potential trouble in getting to it. I've got used to adding shortcuts for everything I need to C:\WINDOWS\START MENU.

That way I can always easily access what I need however much other stuff I have cluttering up the screen - and boy doesn't it get cluttered sometimes?! If you find the start menu gets too tall to fit the screen, you can change it to small icons - right click on the taskbar, select Properties.

Another Windows key tip...

[Windows]+M - minimises all application windows.

Hope that helps someone!

Stewart
 
Jon, any tips how to make such an objects that will be ran by such way using class id? Can we make VFP COM object that will be launched by such way or its should be an ActiveX object anyway?

Vlad Grynchyshyn
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
Vlad,

My apologies for not responding to your inquiry sooner, but I dont quite understand your question. Are you saying you want to add a keyboard shortcut to launch a com object? Or are you asking how to place an icon on the start menu for an automation server that would list all the com exposed objects and they could be ran from there?

If the latter, I dont think so because a the com object(whether in-process or out-of-process) has to have an owning thread.
If the former, you can add a .VBS script to your desktop and define a keyboard shortcut to that. In that script it can create your com object and perform whatever tasks the com object needs. This is actually my perferred approach.

Over the last few months, I've discovered just how useful & powerful .VBS scripts are (not just for deploying email worms). For instance, we have a call logging application that allows us to track all support calls. However to get into the application, you must follow this process:

1. Enter the IP address of the web-server and press enter.
2. After the webserver is found, you have to enter your network username & password and press enter.
3. After network access is authenticated, the app starts and you have to enter your application username and password and press enter.
4. After you're logged into the app, you are prompted Yes or No to restore your previous session, so you always click yes.

I created a simple .VBS script that sits on my desktop and can be launched by pressing CTRL+ALT+H that automates all this login/authentication mess. So, the script performs all these tasks for me. All I do is press a button.

I've also began R&D on using Scripts to replace Launcher applications. One, this would allow the user's desktop shortcut to point to the actual EXE and not the launcher. Two, most launcher's simply deploy the exe. However, with a script, the developer could deploy the exe and any other files. As well as run register any dlls or automation servers. Jon Hawkins

The World Is Headed For Mutiny,
When All We Want Is Unity. - Creed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top