pmcgillan
Posts: 1
Joined: Thu Mar 23, 2006 2:58 pm

dos command

Hi,
I would like to send this dos command out to all of my workstations;

schtasks /create /sc weekly /D WED /TN "Weekly Reboot" /ST 21:00:00 /TR "Shutdown -r -f -t 30" /s %computername% /RU SYSTEM

This way I know every computer got it, but if someone has an easier method other than create and MSI and use a group policy to push it, I am all ears.

Thanks,
Patrick
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Hi Patrick,

You can use an "EXE with Working Dir" Custom Action that will execute this command when the MSI package is installed. This CA will have the following properties:
- Working Dir: (Any)
- Full Path:

Code: Select all

schtasks /create /sc weekly /D WED /TN "Weekly Reboot" /ST 21:00:00 /TR "Shutdown -r -f -t 30" /s [%computername] /RU "System"
- Execution Properties: "Synchronous execution, ignore return code"

Notice how environment variables are specified for the Windows Installer Formatted data type.

However, it is not clear to me what do you mean by "to all of my workstations". If I understand well, why would you want to schedule a task on all computers when the package is installed on one of them?

Regards,
Ionut
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”