Jump to content

Recommended Posts

Antipova Anna
Posted

Advice and Solutions (Forum Knowledgebase) Disclaimer. Read before using materials.

This article is about Kaspersky Security Center for Windows (KSC for Windows)

In this article we will share the steps on how run a .bat file remotely through Kaspersky Security Center (KSC).

How to execute a batch file on the remote hosts

  1. Create an installation package based on a file
    image.thumb.png.d0a2640fedddee9361a41e0aa3666fd5.png
  2. Create a remote installation task for that Installation package
  3. Assign the task to a target hosts and start it

During task execution NAgent will run the file using a 32-bit cmd.exe process (C:\Windows\SysWOW64\cmd.exe) under LocalSystem account.

Limitations

Some commands and programs

  • Do not support execution under LocalSystem account.
  • Are not recognized as internal (external) for 32-bit cmd, thus can not be started from 32-bit cmd.exe process.

How to execute batch file using 64-bit cmd.exe process:

  1. Add symbolic link to 64-bit cmd.exe in the script
  2. Run all cmdlets using this symlink
     
Example
REM the following creates symlink 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

Using x64 versions of commands.

For example, to import .reg file you need to create the following bat file:

Example
echo off
 
reg add <reg file> /reg:64

You can find x64 versions of the commands online.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


×
×
  • Create New...