Command line parameter examples

Kaspersky Research Sandbox allows you to start object execution with specific command line parameters. The Command line parameters field is optional and available only when a Microsoft Windows or Linux execution environment is selected.

You can use environment variables by placing the % sign in front of and after the variable name, for example: %SYSTEMROOT%. By default, the environment variables are expanded on the user's host, before transferring and executing the object in the Sandbox. To transfer environment variables to the Sandbox as is, without expansion, use the %% sign, for example: %%SYSTEMROOT%%.

In Linux, use the -C key in the command line interpreter to transfer system variables to the Sandbox, for example: /bin/bash -c "$sample -lah $PWD >> $PWD/$HOSTNAME.log"

The command line may contain a variable $sample that will be replaced in the Sandbox with the actual path to the object in the operating system (for example, <notepad path> /A $sample).

The length of the command line must not exceed 1024 characters, otherwise Kaspersky Research Sandbox will shorten it. Depending on the technical constraints of an operating system that is used as an execution environment in the Sandbox, the length of the command line may be further shortened.

Examples:

Specify an application that you want to execute the object with:

%windir%\System32\notepad.exe /a $sample

"%ProgramFiles%\Internet Explorer\iexplore.exe" $sample

Specify a file to write the output of the object to:

$sample > %userprofile%\test_output.txt

Execute an object and write the output into a file that includes the computer name as the file name:

$sample --t –r=2 >> %TEMP%\%COMPUTERNAME%.txt

Specify keys for an object execution in Linux execution environment:

$sample -key1=1 -key2=two

Environment variables usage

Environment variables

Microsoft Windows 10 x64

Microsoft Windows 7 x64

Microsoft Windows 7

Microsoft Windows XP

Linux

ALLUSERSPROFILE

Yes.

Yes.

Yes.

Yes.

APPDATA

Yes.

Yes.

Yes.

Yes.

CLIENTNAME

Yes.

CommonProgramFiles

Yes.

Yes.

Yes.

Yes.

CommonProgramFiles(x86)

Yes.

Yes.

CommonProgramW6432

Yes.

Yes.

COMPLUS_ProfAPI_ProfilerCompatibilitySetting

Yes.

Yes.

Yes.

Yes.

COMPUTERNAME

Yes.

Yes.

Yes.

Yes.

ComSpec

Yes.

Yes.

Yes.

Yes.

COR_ENABLE_PROFILING

Yes.

Yes.

Yes.

Yes.

COR_PROFILER

Yes.

Yes.

Yes.

Yes.

DriverData

Yes.

FP_NO_HOST_CHECK

Yes.

Yes.

Yes.

HOME

Yes.

HOMEDRIVE

Yes.

Yes.

Yes.

Yes.

HOMEPATH

Yes.

Yes.

Yes.

Yes.

LOCALAPPDATA

Yes.

Yes.

Yes.

LOGNAME

Yes.

LOGONSERVER

Yes.

Yes.

Yes.

Yes.

MAIL

Yes.

NUMBER_OF_PROCESSORS

Yes.

Yes.

Yes.

Yes.

OneDrive

Yes.

OS

Yes.

Yes.

Yes.

Yes.

Path

Yes.

Yes.

Yes.

Yes.

Yes.

PATHEXT

Yes.

Yes.

Yes.

Yes.

PROCESSOR_ARCHITECTURE

Yes.

Yes.

Yes.

Yes.

PROCESSOR_IDENTIFIER

Yes.

Yes.

Yes.

Yes.

PROCESSOR_LEVEL

Yes.

Yes.

Yes.

Yes.

PROCESSOR_REVISION

Yes.

Yes.

Yes.

Yes.

ProgramData

Yes.

Yes.

Yes.

ProgramFiles

Yes.

Yes.

Yes.

Yes.

ProgramFiles(x86)

Yes.

Yes.

ProgramW6432

Yes.

Yes.

PROMPT

Yes.

Yes.

Yes.

Yes.

PSModulePath

Yes.

Yes.

Yes.

PUBLIC

Yes.

Yes.

Yes.

PWD

Yes.

SESSIONNAME

Yes.

Yes.

Yes.

Yes.

SHELL

Yes.

SHLVL

Yes.

SystemDrive

Yes.

Yes.

Yes.

Yes.

SystemRoot

Yes.

Yes.

Yes.

Yes.

TEMP

Yes.

Yes.

Yes.

Yes.

TERM

Yes.

TMP

Yes.

Yes.

Yes.

Yes.

USER

Yes.

USERDOMAIN

Yes.

Yes.

Yes.

Yes.

USERDOMAIN_ROAMINGPROFILE

Yes.

USERNAME

Yes.

Yes.

Yes.

Yes.

USERPROFILE

Yes.

Yes.

Yes.

Yes.

windir

Yes.

Yes.

Yes.

Yes.

windows_tracing_flags

Yes.

Yes.

windows_tracing_logfile

Yes.

Yes.

XDG_RUNTIME_DIR

Yes.

XDG_SEAT

Yes.

XDG_SESSION_ID

Yes.

XDG_VTNR

Yes.

Page top