Как я могу удаленно выполнить сценарий в Windows?

Они изменяют «компиляцию» на «реализацию» на последнем Gradle, поэтому вам нужно изменить

 dependencies {
    compile 'com.kontaktio:sdk:3.0.2'
}

на

 dependencies {
    implementation 'com.kontaktio:sdk:3.0.2'
}
10
задан Daniel 14 May 2009 в 01:43
поделиться

3 ответа

psexec из SysInternals

14
ответ дан 3 December 2019 в 16:10
поделиться

Изучите синтаксис AT-команды. Вы можете использовать его для планирования запуска процесса на удаленном компьютере.

AT-команда планирует команды и программы для запуска на компьютере в указанное время и дату. Для использования службы расписания должна быть запущена команда AT.

AT [\\computername] [ [id] [/DELETE] | /DELETE [/YES]]
AT [\\computername] time [/INTERACTIVE]
    [ /EVERY:date[,...] | /NEXT:date[,...]] "command"

\\computername     Specifies a remote computer. Commands are scheduled on the
                   local computer if this parameter is omitted.
id                 Is an identification number assigned to a scheduled
                   command.
/delete            Cancels a scheduled command. If id is omitted, all the
                   scheduled commands on the computer are canceled.
/yes               Used with cancel all jobs command when no further
                   confirmation is desired.
time               Specifies the time when command is to run.
/interactive       Allows the job to interact with the desktop of the user
                   who is logged on at the time the job runs.
/every:date[,...]  Runs the command on each specified day(s) of the week or
                   month. If date is omitted, the current day of the month
                   is assumed.
/next:date[,...]   Runs the specified command on the next occurrence of the
                   day (for example, next Thursday).  If date is omitted, the
                   current day of the month is assumed.
"command"          Is the Windows NT command, or batch program to be run.
6
ответ дан 3 December 2019 в 16:10
поделиться

Принятое решение от http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Q_22959948.html это:

Я предоставил сценарий, который принимает параметры ... В данном случае требуется 4. 1) Сервер: если вы пропустите -server, он будет только один сервер 2) Список: вы может предоставить файл списка серверов. 3) Служба: название службы, которую вы хочу изменить 4) Подробно: нет используется здесь.

У меня были ошибки, которые я изменен в следующем коде. Использовать вырезать / вставить код в файл с именем Set-RemoteService.ps1. Убедись в установите свою политику выполнения на запуск скрипты ... по умолчанию не будет. Вы сделать это с помощью командлет set-executionpolicy. PS> Установите-Executionpolicy "RemoteSigned" на запустите сценарий, который вы делаете PS> C: \ PathToScript \ Set-RemoteService.ps1 -list c: \ ServerList.txt -service "DHCP"

######################## Param ($ server, $ list, $ service, [switch] $ verbose)

if ($ Verbose) {$ VerbosePreference = "Продолжить"} if ($ list) { foreach ($ srv в (get-content $ list)) { $ query = "Выберите * из Win32_Service, где Name = '$ service'" $ myService = get-WmiObject -query $ query -computer $ srv $ MyService.ChangeStartMode ( "Automatic") $ MyService.Start () }} if ($ server) { $ query = "Выберите * из Win32_Service, где Name = '$ service'" $ myService = get-WmiObject -query $ query -computer $ server $ MyService.ChangeStartMode ( "Automatic") $ myService.Start ()}

0
ответ дан 3 December 2019 в 16:10
поделиться
Другие вопросы по тегам:

Похожие вопросы: