Solved

Correct syntax for using "-autostart" when running a windows exe via scheduled task

Posted on 2009-05-07
3
538 Views
Last Modified: 2012-05-06
Hi, I am working on my first windows scheduled task. I want to add "-autostart" to this scheduled task:

Run: "C:\Documents and Settings\Administrator\Desktop\GDocBackup.0.3.0.BIN\GDocBackup.exe"

Start in: Settings\Administrator\Desktop\GDocBackup.0.3.0.BIN"

--

This is the exe I am trying to autostart in a scheduled task:

http://gs.fhtino.it/gdocbackup

This is info from developer about -autostart usage:

Command line options:

    * -autostart :   Automatically starts backup. If no errors are encountered, the GDocbackup quits automatically. If there are errors, the standard message box appears. The switch is useful for scheduled run. An example:schedule it at session start / login, so, when you login, GDocDackup starts automatically and downloads all modified documents.
    * -writelog :   Writes log message to a text file. Filename: GDocBackup_yyyyMMdd.log.  Path on Windows Vista, the user temp directory (C:\Users\USERNAME\AppData\Local\Temp\). Oon Linux:  /tmp/


--

If I can get the -autostart to work. Can I have both -autorun and -writelog in same run command?

Thanks for any info.

0
Comment
Question by:Mark B
3 Comments
 
LVL 22

Assisted Solution

by:rickhobbs
rickhobbs earned 200 total points
ID: 24331295
Depending on how the exe parses the command line, it would be either:
Run: "C:\Documents and Settings\Administrator\Desktop\GDocBackup.0.3.0.BIN\GDocBackup.exe -autostart"
or
Run: "C:\Documents and Settings\Administrator\Desktop\GDocBackup.0.3.0.BIN\GDocBackup.exe" -autostart

As for mixing the command functions, get the first one to work and the try the others.  It depends on whether the exe will accept the additional switches.
0
 
LVL 3

Accepted Solution

by:
ranit8 earned 300 total points
ID: 24331876
"C:\Documents and Settings\Administrator\Desktop\GDocBackup.0.3.0.BIN\GDocBackup.exe -autostart"
This cant work (except in the unlikely case you do have a file named "GDocBackup.exe -autostart" in that folder)

"C:\Documents and Settings\Administrator\Desktop\GDocBackup.0.3.0.BIN\GDocBackup.exe" -autostart -writelog
This is the correct command line. I wouldnt think twice about using both parameters at the same time as they do not oppose each other. And most times the developer will say to not use them at the same time if they are not compatible. It's a simple task, no reason to believe that application would fail to do this.
0
 

Author Closing Comment

by:Mark B
ID: 31579248
Thank you, this work great: "C:\Documents and Settings\Administrator\Desktop\GDocBackup.0.3.0.BIN\GDocBackup.exe" -autostart -writelog
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

We have adopted the strategy to use Computers in Student Labs as the bulletin boards. The same target can be achieved by using a Login Notice feature in Group policy but it’s not as attractive as graphical wallpapers with message which grabs the att…
VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now