Contact Sales

To contact our sales team, you can use the form below. Do not use this form for tickets or help desk, click here to create a ticket.

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

Synchronise and migrate users and workstation between on-prem AD, Entra ID, Google the easy way. Seamlessly Move devices between AD Joined, Hybrid and Entra Joined.
  • Create ticket
  • Home
  • Migration Agent

How to create a command line package to Run.

Written by Neil Langston

Updated at April 3rd, 2026

Contact Sales

To contact our sales team, you can use the form below. Do not use this form for tickets or help desk, click here to create a ticket.

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
  • Install and Configure
  • Support
  • Complex Expressions
+ More

Table of Contents

Size of cmdline.cmd Logging to PowerSyncPro Console

At the start-up or completion of your runbook you can run a script that as the local SYSTEM Account.  You will need to package the script within a zip file for it to execute. 

Size of cmdline.cmd

PowerSyncPro is not designed as software delivery or the distribution of files, you should keep your script and cmdline.cmd file as small and efficient as possible. Any changes to a runbook will trigger a full download to every workstation in scope for the associated batch.

If you need to distribute a large binary (e.g. installer) you should consider uploading the file to a publicly available URL (e.g. Azure Bucket) and having PowerShell download the file from that location.

 

 

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. PowerSyncPro Migration Agent will look for a file named cmdline.cmd and execute that.

Put the following code in the script and save

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

Logging to PowerSyncPro Console

If you would like the output of the script logged directly to the PowerSyncPro console, you can add a /B to the start command.  This will log the output of the Batch / PowerShell script to the PowerSyncPro Agent logs.

start /WAIT /B "" "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 together into a single compressed file (named anything you like), and upload it to the PSP runbook on either start-up or completion depending on your requirements.

 


 

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's logo

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

Expand