US English (US)
GB English (UK)

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Create ticket
English (US)
US English (US)
GB English (UK)
  • Home

How to create a command line package to Run.

Written by Neil Langston

Updated at October 17th, 2024

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Getting Started
  • FAQs
  • API Documentation
  • Integrations
  • Migration Agent
  • Directory Synchronisation
  • Remote DC agent
  • Remote Password Sync Agent
+ More

At the startup or completion of your runbook you can run a script under SYSTEM.

 

You will need to package the script within a zip file for it to execute.

 

There are lots of options here, if you wish to run powershell to create a folder here is an example

 

Create a file called “cmdline.cmd” this will be run using command prompt. (it must be name this in all circumstances)

Put the following code in the script and save

start /WAIT "" "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy Bypass -File .\myscript.ps1

 

Then, create another file “myscript.ps1”

<#
    .DESCRIPTION
        This script will create a directory on the system
    .AUTHOR
        POwerSyncPro
    .Version
        0.1
#>

Start-Transcript -Path "C:\windows\temp\PSPScript.txt"

$diagPath = "C:\My_New_Folder"

# Create Directory
if(!(Test-Path -PathType container $diagPath))
{
      New-Item -ItemType Directory -Path $diagPath
      Write-Host "Folder created."
}else{
      Write-Host "Folder exists."
}

Stop-Transcript

 

You will then zip these two files into a single compressed file, and upload it to the PSP runbook


 

command line package

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • Setup Migration Agent to reconfigure Azure Information Protection
  • Office Applications or Outlook failing to log in after migration

Subscribe to Newsletter

Drop your email in the box below to sign up. We promise to keep our updates relevant and useful – and we’ll never share your details.

PowerSyncPro is the ultimate product for easing the pain and frustration during mergers, acquisitions, divestitures, and consolidations.

Terms & Conditions

  • FAQs
  • Privacy Policy
  • Cookies
  • Anti Slavery Notice

PowerSyncPro

  • Case Studies
  • Contact sales
  • Meet the Team
  • EULA

Get Connected

Room 73, Wrest House, Wrest Park, Silsoe, Bedford, England, MK45 4HR
info@powersyncpro.com

Twitter Youtube Linkedin

Knowledge Base Software powered by Helpjuice

Expand