Solved

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

Posted on 2009-05-07
3
545 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:Rick Hobbs
Rick Hobbs 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you unable to synchronize your OST (Offline Storage Table) file with Microsoft Exchange Server? Is your OST file exceeding 2 GB size limit? In Microsoft Outlook 2002 and earlier versions, there is a 2 GB size limit for the OST file. If the file …
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

895 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

13 Experts available now in Live!

Get 1:1 Help Now