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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Basic XP Scheduled Task Problem 2

Status
Not open for further replies.

rdy4trvl

Technical User
Feb 26, 2001
90
US
I can easily add programs to the Scheduled Task function in XP. However, how do I get a program to run if, once the program opens it requires someone to click “run” or like with Ad-Aware which requires “start” then “next”? Better question – is it possible to do this without knowing C, C++, Fortran, Java, VB, etc?
Thanks!!!
 
See if the program has a command line option. For example with AdAware:
Ad-Aware can be operated without using the graphical user interface (GUI). It can be controlled by using command line parameters. UNC paths are supported.

Example:

Ad-Aware.exe /smart +silent +update +nice-2



Ad-Aware will run silently (without the GUI) in the background, checks for definitions file updates before it performs the scan, and then performs a Smart System scan at IDLE priority

Available command line parameters
/smart
Performs a Smart System scan

/full
Performs a Full System scan

/custom
Performs a scan using Custom Scanning options predefined by the user

/ads
Performs an ADS (Alternate Data Stream) scan and is only available on NTFS enabled volumes
Using /ads alone will run the ADS scan using the parameters (paths) defined in the scan settings
Using /ads with a path as the very first parameter, for example %Ad-Aware.exe% "C:\test" /ads will run an ADS scan on the defined path

/?
Displays a help window with a listing of all the available command line parameters

/help
Displays help on available command line parameters

/paths:"%pathsfile%"
%pathfile% defines a text file which includes a list with paths that will be scanned. %pathfile% can also specify a remote resource.

/sdump:"%destinationfile%"
Creates a file containing status information at the specified location. This command requires a destination file name. Information appended to the file created will include version, build, loaded definitions file, available add-ons, scanning statistics, etc

+archives
Overrides any archival scan settings so that archives are scanned

-archives
Overrides any archival scan settings so that archives are not scanned

+auto
Performs both scanning and removal in full-automatic mode using the automatic quarantine and log file settings defined by the user

+cskip
Skips the conditional scans

+delay
Activates delayed loading

+diskonly
Only performs a disk scan. It will not perform any memory/registry scans

+log:"%destination%"
Creates a log file at the specified path. The full path name must be added in quotes

+mru
Scans for negligible risk objects and temporarily overrides the last user setting for that option

-mru
Skips the scan for negligible risk objects and temporarily overrides the last user setting for that option

+nice+/-n
"+" boosts priority: ABOVE_NORMAL_PRIORITY_CLASS up to REALTIME_PRIORITY_CLASS
(+nice+1 or +nice+2 respectively)

"-"decreases priority: BELOW_NORMAL down to IDLE
(+nice-1 or +nice-2 respectively)

+nodefnotice
No warning will be given if the definitions file is outdated

+noset
Scan will not alter any user data

+nowrite
Disables all writing to disk. Ignore lists, cache and preferences are not saved if this switch is used

+prefs:"%file%"
Uses a user-defined preference file for the scan. The full path and file name must be added in quotes

+procnuke
Performs an aggressive memory scan. Ad-Aware will try to unload/terminate the process/module and immediately delete it. This is required to handle reciprocal processes for example. It also unloads explorer and recognized modules during the removal, regardless of whether or not the tweak options are set

+ref:"%file%"
Uses user-defined definitions file for the scan. The full path and file name must be added in quotes

+remove:n
n must be a number between 0 and 10. If used in combination with the /auto parameter, only content that has an equal or higher TAC index will automatically be removed

+retv:[out]
Returns the highest TAC rating of all objects found as exit code

+safeload
Loads the minimal configuration required for Ad-Aware SE to operate. Skips loading of cache files, ignore list, plug-ins and extensions. If there are problems launching Ad-Aware SE the conventional way, use this command.

+sd
Sends command to running instance of Ad-Aware

+silent
Runs Ad-Aware without showing the graphical user interface and scans automatically without removing any detected objects

+update
Checks if a new definitions file is available and downloads it on Ad-Aware SE startup

In the alternative, schedule a WSH script and use the SENDKEYS feature:
 
So it sounds as though using the Task Scheduler is not possible where sometype of input is required? I'm not sure, but that would exclude most programs then (Virus detection, defrag, etc all require the user to click "start").

For the programmer-wantabes (you'll like this question), where does the "Ad-Aware.exe /smart +silent +update +nice-2 " go? Have to learn sometime I suspect.....or is there somewhere I can go to learn the basics of whatever this is?
Thanks

 
What Bcast showed was what are called command lines. These can be added to shortcuts (where they apply) to have a program launch with specific behaviours.

"Ad-Aware.exe /smart +silent +update +nice-2" This will go in your shortcut, on the desktop, in the target line...what you would see is..

C:\program files\Ad-Aware\Ad-Aware.exe /smart +silent +update +nice-2.

That same line, is the one you would use for the scheduler to have it run with the chosen options when scheduled.
 
Many, not all, software admits of a command line option. It is buried somewhere in the manual, and can usually be found if the software manufacturer has an online forum. Or google it: for example, adaware command line

Most defragmentation and AV softwares include a scheduling option. Or if a command line exists, you can use the native XP schtasks or the AT command as in this example:

c:\at 12:00 /every:M,W,F defrag c:

This example uses the native scripting tools of XP to create a target for Scheduled Tasks. It will defrag all drives. Use notepad to copy/paste the below, and save as defrag.vbs

********* defrag all drives. Save as defrag.vbs and use
********* as the target of your scheduled task
Set WshShell = WScript.CreateObject("WScript.Shell")

Dim fso, d, dc
Set fso = CreateObject("Scripting.FileSystemObject")
Set dc = fso.Drives
For Each d in dc
If d.DriveType = 2 Then
Return = WshShell.Run("defrag " & d, 1, TRUE)
End If
Next
********* end WSH example of a script to defrag all drives

 
bcastner & aquias - Thanks!
I think I understand...now I'll give it a try.

From the most basic users view point - there are some huge opportunities (understatement) to automate, simplify and improve software in this arena.

Again thanks!!!
 
Sorry, more hand holding requried...

My Target box shows "C:\Program Files\Lavasoft\Ad-Aware SE Personal\Ad-Aware.exe"

So I modified it to "C:\Program Files\Lavasoft\Ad-Aware SE Personal\Ad-Aware.exe /smart +silent +update +nice-2" but get an error message when I try to save the new short cut - "Target Box not Valid" Check path and file name....

What am I missing?
Thanks
Doug
 
C:\Program Files\Lavasoft\Ad-Aware SE Personal\Ad-Aware.exe" /smart +silent +update +nice-2
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top