Comment lancer une tâche avant l'arrêt du PC

Didier -  
 Didier -
Bonjour à tous,
Je souhaiterai créer une tâche planifiée qui lancerait Spybot 1 fois par semaine et qui s'exécuterait au moment où on demande l'arrêt du PC, l'arrêt du PC se faisant automatiquement à la suite.
J'ai cherché dans la création de tâche planifiée et dans le forum mais n'est pas trouvé le fonctionnement que je veux.
Je suis sous XP pack 3
Merci de vos réponses
A voir également:

7 réponses

gonzalezg Messages postés 6 Statut Membre 1
 
je pense que le mieux serait de créer un fichier batch que tu lancerai et qui lancerai spybot et éteindrai le PC un fois le scan fini
1
Didier
 
Pourtant certaines mises à jour logicielles se font de cette façon, mais je ne sais pas du tout comment ca se fait. Passer par un fichier batch est une solution mais nécessite de ne pas oublier de lancer ce fichier, j'aurai préféré quelquechose d'automatique.
0
junico
 
Bonjour Didier
Rien n'empêche de lancer un fichier .BAT par une tâche planifiée !!!
0
Didier
 
OK Junico pour le .BAT mais je n'ai pas trouvé comment créer une tâche planifiée qui s'exécuterait juste avant l'arrêt du PC, comme certaines mises à jour qui se font quand on demande l'arrêt du PC.
0
junico
 
RE...
Dans ton .bat, la dernière commande doit-être: Shutdown -f -r
Cela fermera les fichiers restés ouverts, et éteindra le PC
Dans ce cas via la tâche planifiées ( je vois pas l'intéret de planifier un arret de PC via cette option ) ou via le fichier .bat lui même ( icone sur le bureau pour faciliter) , tu lances spybot et puis tu arrête ton PC automatiquement.
PS tu peux en profiter pour lancer une sauvegarde également.
A te lire
0
junico
 
Oups !!! shutdown -f -s
0
Utilisateur anonyme
 
spybot ne vaut plus rien...pourquoi tu t'embete ? :)
0
junico
 
Cela ne rend aucun service à sa demande !!!! elle reste pour d'autres programmes que Spybot !!
0
Utilisateur anonyme
 
oui, c'est pas faux....
mais....
via un bat, ca va etre chaud :
tu peux lancer le programme mais le bat lancera la commande shutdown avant meme que ton programme est fini...sauf....si tu termine ton bat avec pause > shutdown ...ce qui obligerais a retourner sur la fenetre du bat et à appuyer sur une touche pour lancer shutdown
moi ce que je ferais :
ton bat
un raccourci sur le bureau et barre de lancement rapide, menant direct au bat avec une combinaison de touche (propriété du raccourci)....
ce qui permet, par exemple de lancer ton bat en faisant Ctrl+F1 > lancement du programme
0
junico
 
Sorry C'est faux !!!
La commande Call permet de faire cela.
Comme je le fais pour lancer un backup suivit d'un arrêt de PC.
EX:
echo off
cd C:\Program Files\SyncToy 2.0
call SyncToyCmd.exe -r
shutdown -s -f
0
Didier
 
Passer par un .BAT me semble effectivement compliqué mais bon si ça marche ... En fait je ne voudrai pas avoir à me soucier de lancer Spybot et autres régulièrement et voudrai donc que cela se fasse automatiquement quand je demande l'arrêt du PC.
D'autre part, tu me dis homer_s que Spybot est dépassé, que me préconises tu ?
0
junico Messages postés 129 Statut Membre 17
 
Didier ... J'te comprend pas!
Pour arrêter ton PC tu dois faire DEMARRER puis ARRETER l'ordinateur ...
Une icône sur le bureau qui lance un fichier.bat est encore plus simple :double click dessus et tout se fait comme tu veux !!!!
Enfin c'est toi qui voit.
0
batoune Messages postés 558 Statut Membre 96
 
Salut

Moi pour automatiser certaine tache sur mon PC je me suis servi de ce petit logiciel :
https://www.autoitscript.com/site/autoit/

Y'a de bon exemple très complet et il offre la possibilité d'enregistrer les action faite a l'écran pour en faire un script, de tester l'apparition (ou la fermeture) d'une fenêtre.

Sa devrait te permettre de trouver ton bonheur
0
Didier
 
Bonjour à tous, j'ai supprimé Spybot et ai installer Malwarebytes à la place. En fait je vais faire comme vous me le proposiez c'est à dire créer un fichier Batch.
Je souhaiterai que ce batch lance un scan minitieux avec Malwarebytes puis une fois terminé qu'il lance un scan minitieux avec Avast et enfin que le PC s'arrête seul.
Mais maintenant j'ai des problèmes, quand on lance Malwarebytes il faut faire plusieurs Return pour que le scan démarre et je n'arrive pas à rentrer ces "return" dans le BATCH.
Voici je que j'ai mis pour l'instant
echo on
cd C:\Program Files\Malwarebytes' Anti-Malware
call mbam.exe

A ce niveau d'exécution du BATCH, la fenêtre Malwarebytes est ouverte mais le scan ne part pas !
Pourriez vous me dire ce qu'il faut modifier ou ajouter ?
Merci, Didier
0
junico Messages postés 129 Statut Membre 17
 
Salut didier
Voici la doc :

Command Line Parameters
Malwarebytes Anti-Malware supports a variety of command line parameters, which can be used from either a command prompt, batch file or script. (Note: some of these parameters are available in the PRO version only.)

mbam.exe <parameters>

(where parameters is one or more of the following)

/errorsilent: suppresses all critical errors and writes the last error to <root-drive>\mbam-error.txt where <root-drive> is the hard drive where Windows is installed, also known as the System Drive.

Example:

mbam.exe /errorsilent will suppress all errors when the program is running.
/proxy <required server> <optional port> <optional username> <optional password>: allows the user to update through a proxy server. Leave blank to remove any proxy settings previously set.

Examples:
mbam.exe /proxy will remove the proxy settings.
mbam.exe /proxy proxy.com 80 will use proxy.com on port 80 with no credentials.
mbam.exe /proxy proxy.com 80 admin password will use proxy.com with the specified credentials.
/logtofolder <optional path>: allows the user to save all log files to the specified folder. If this folder does not exist, Malwarebytes Anti-Malware attempts to create it. If the path is blank, changes are reverted to default settings. These logs do not show up on the Logs tab.

Example:

mbam.exe /logtofolder C:\mbam_log_files will save all future log files to the location C:\mbam_log_files.

Note: Protection logs created by the protection module will always be saved to the same location
/logtofile <optional path>: allows the user to save all log files to the specified file. If this file does not exist, Malwarebytes Anti-Malware attempts to create it. Newest entries are appended to top of the file. If the path is blank, changes are reverted to default settings. This log does not show up on the Logs tab.

Example:

mbam.exe /logtofile C:\mbam_log_files\mbam-log.txt will save all future log files to the location C:\mbam_log_files\mbam-log.txt.

Limitations: The path, in the above case C:\mbam_log_files, must exist. This option will not create folders if they don't exist, only the log file.

Note: Protection logs created by the protection module will always be saved to the same location
/debug <optional -silent>: allows the user to collect information to send as a bug report.

Examples:
mbam.exe /debug will bring up a prompt to save the debug file.
mbam.exe /debug -silent will save debug file silently to <root-drive>\mbam-info.txt where <root-drive> is the hard drive where Windows is installed, also known as the System Drive.
/register: allows the user to register the program without displaying the main dialog box.

Examples:

mbam.exe /register 12345-67890 AAAA-BBBB-CCCC-DDDD will register the product using the license key passed in the parameters.

Limitations: Protection must be enabled using the program user interface if it is to be enabled before the system restarts.
/developer: this command line parameter is used to execute the program in developer mode and will create a log with encrypted information on items detected in a scan. It is used for reporting false positives and allows the researchers to determine why an item is being detected. Example: mbam.exe /developer will start the program with detailed detection information.

Note: When reporting a false positive, please be sure to use the /developer switch and provide the resulting log to the researchers.
/update <optional -silent>: allows the user to update the product and database.

Examples:
mbam.exe /update will attempt to update the database or program, depending on settings.
mbam.exe /update -silent will attempt to update the database or program silently.
/scan <optional -quick or -full or -flash> <optional -silent> <optional -remove> < optional -terminate> <optional -reboot> <optional -log>: initiates a scan with the selected options.

Parameters:

-quick: initiates a quick scan.
-full: initiates a full scan using saved drives in the registry.
-flash: initiates a flash scan of memory and heuristics only.
-terminate: closes the program after a scan completes and no threats were found (cannot be used with -silent). If an item is detected, the program remains open so that the user can decide whether or not to remove the detected threat(s).
-log: overrides the save log checkmark on the settings tab. If the Automatically save log after scan completes option is unchecked, a log file will still be saved when the -log parameter is used.
-silent: hides the GUI while scanning (does not need to be used with -terminate).
-reboot: reboots the computer if necessary, only valid if -silent is used.
-remove: automatically removes threats and saves a log file. Unless -silent is specified, GUI stays open.
Examples:

mbam.exe /scan will run a default scan.
mbam.exe /scan -full will run a full scan.
mbam.exe /scan -flash -terminate will run a flash scan and terminate if no objects are detected.
mbam.exe /scan -quick -log -silent -remove -reboot will run a quick scan silently, save logs, automatically remove threats, and reboot if necessary.
Limitations:

-terminate parameter cannot be used with the -silent parameter since the program will automatically terminate when the -silent parameter is used.
-reboot parameter is only valid if used with the -silent parameter.
/schedule <optional /update or /scan -quick or /scan -full or /scan -flash> <optional /realtime or /hourly or /daily or /weekly or /monthly or /once or /onreboot>: these items allow the user to choose the frequency for the scheduled update or scan to occur:

<optional /starting mm/dd/yyyy hh:mm:ss>: this item allows the user to set the time for the scheduled scan or update to start.
For /realtime omit this - the current time is assumed.
For /random - this item selects a random time to set the scheduled scan or update to occur. /random may only be used with /hourly or /daily and randomizes the Hour and Minute or Hour and Minute and Second respectively
<optional /every X where X is a number for the frequency of the scan or update to occur> <optional /recover X where X is the number of hours for the scan or update to attempt to run again if the computer was unavailable during the scheduled time>
<optional /wakefromsleep>: may be used with a scan or an update. Malwarebytes Anti-Malware will attempt to wake the computer from sleep to perform the scheduled scan or update.

Limitations: Not supported with /onreboot for scans or /realtime or /onreboot for updates.
<optional /flash executes a Flash Scan after a successful update

Note: only used with /update>
Examples:

/schedule /scan -quick -remove -terminate -log /daily /starting 08/10/2010 23:00:00 /every 1 /silent /wakefromsleep will schedule silent daily Quick Scan starting on August 10th, 2010 at 11:00PM that will repeat every 1 day, remove threats, reboot if necessary, force the creation of a scan log and will attempt to wake the computer from sleep to perform the scan.
/schedule /update /flash /realtime /every 5 will schedule an update to occur in real-time once every 5 minutes and set a Flash Scan to occur after each successful update.
/unschedule <optional /all or /all -update or /all -scan>.
Note: You can remove individual scans or updates by not including the /all switch and specifying the exact switches used to create the scan or update

/all removes all scheduled scans and updates.
/all -update removes all scheduled updates.
/all -scan removes all scheduled scans.
Examples:

/unschedule /scan -quick -remove -terminate -log /daily /starting 08/10/2010 23:00:00 /every 1 /silent will delete a scheduled silent daily Quick Scan that was set to start on August 10th, 2010 at 11:00PM that was set to repeat every 1 day, remove threats, reboot if necessary, and force the creation of a scan log.
/unschedule /update /flash /realtime /every 5 will delete a scheduled update that was to occur in real-time once every 5 minutes and with a Flash Scan set to occur after each successful update.
/setpassword sets or changes the password to access certain features of the product.

Examples:
/setpassword <password> sets the password to "password"
/setpassword <oldpassword> <newpassword> changes the password to "newpassword"
/clearpassword <password>: removes the password.

Example:
/clearpassword password removes all password protection if the password was "password"
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
Didier
 
Merci Junico pour les codes, je vais essayé ça
0
Didier
 
Bonjour,
Voici ce que j'ai essayé pour lancer Malwarebytes (mise à jour puis scan minutieux) :

echo on
cd C:\Program Files\Malwarebytes' Anti-Malware
mbam.exe/update
mbam.exe/scan -full -terminate

Ca marche bien, mais après avoir fait les mises à jour, le logiciel attend que l'opérateur clique sur OK. Est il possible de passer outre et de lancer le scan à la suite sans intervention de l'opérateur ?

D'autre part, je souhaiterai lancer à la suite de Malwarebytes un scan avec Avast. Dans Avast j'ai créé un scan personnalisé nommé ScanPC, puis après avoir trouvé les commandes dans l'aide j'ai fait dans un premier temps un BATCH spécifique :

echo on
cd C:\Program Files\Alwil Software\Avast5
AvastUI.exe /@=ScanPC /p

Le problème est que le logiciel se lance bien mais aucun scan démarre ! Pourquoi ?
Je precise que j'ai les versions gratuites de Malwarebytes et de Avast.
0
junico Messages postés 129 Statut Membre 17
 
Bonjour,
Essaye comme ceci :



echo on
cd C:\Program Files\Malwarebytes' Anti-Malware
Call mbam.exe/update -silent
Call mbam.exe/scan -quick -log -silent -remove

PS: -quick a été utilisé pour tests (plus rapide) à remplacer par -full

Pour avast, essaye avec Call également (je ne connais pas les commande d'Avast)

Dis moi et à te lire
Junico
0
Didier
 
Bonjour Junico,
Pour Malwarebytes, j'ai essayé ce que tu m'a proposé mais j'ai un message me disant que la fonction ne marche qu'avec les utilisateurs enregistrés, il s'agit en fait de la fonction " -silent ", malheureusement j'ai la version gratuite.

En ce qui concerne Avast, j'ai vu par la suite qu'il n'était possible de lancer un scan par Batch que pour les versions payantes ! encore dommage pour moi qui ai la version gratuite.

Je vais donc pour le moment continuer comme je faisais en lançant régulièrement ces logiciels manuellement. Quand j'aurai du temps j'essayerai de lancer ces logiciels en simulant le déplacement de la souris ou l'appuie sur les flèches du clavier, bien sûr ça ne se fera pas avec un fichier Batch mais ça c'est encore une autre histoire.

Merci pour ton aide
Didier
0