Jump to content

如何远程运行bat文件 [KSC for Windows]


Recommended Posts

有时需要在管理的主机上执行批处理文件。执行时,请注意以下信息。

在远程管理的主机上执行批处理文件:

  1. 基于文件创建安装包
  2. 为该安装包创建一个远程安装任务
  3. 将任务分配给目标主机并启动它

在任务执行期间,NAgent将在LocalSystem帐户下使用32cmd.exe进程(C:\Windows\SysWOW64\cmd.exe)运行该文件。

局限性

一些命令和程序

  • 不支持在 LocalSystem 帐户下执行。
  • 对于32cmd,不将其识别为内部(外部),因此无法从32cmd.exe进程启动。

使用64cmd.exe进程执行批处理文件:

  1. 在脚本中添加simlink64cmd.exe
  2. 使用此simlink运行所有cmdlet
例如:
REM the following creates simlink named cmdin64.exe to C:\Windows\System32\cmd.exe
cmd.exe /c mklink cmdin64.exe "C:\Windows\System32\cmd.exe"
REM next line starts uwfmgr.exe with , which is not recognized as internal or external for 32-bit cmd.exe
cmdin64.exe /c uwfmgr.exe

或者:

使用x64版本的命令。例如,要导入reg.file,您需要创建以下bat文件:

例如
echo off
 
reg add <reg file> /reg:64

您可以在网上找到x64版本的命令。

 

 Reply to this topic...
 
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


×
×
  • Create New...