0

So I have psexec64 to run a program as system user. The program is SyncToyCmd:

Here is it sucessfully on previleged powershell:

PS C:\Users\User> where psexec64
PS C:\Users\User> gcm psexec64

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     PsExec64.exe                                       2.43.0.0   C:\Program Files\PSTools\PsExec64.exe


PS C:\Users\User> & "C:\Program Files\PSTools\PsExec64.exe" -s "C:\Program Files\SyncToy 2.1\SyncToyCmd.exe" -R ssd-to-vhd

PsExec v2.43 - Execute processes remotely
Copyright (C) 2001-2023 Mark Russinovich
Sysinternals - www.sysinternals.com


Preview of ssd-to-vhd (D:\ssd-sync\, E:\vhd-sync\) in time 00:00:05:820.
SyncToy action was 'Echo'
Found 0 actions to perform.
Found 18.004 files that did not require action.
Analyzed 3.093,4 files per second.
Avoided copying 14.491.829.994 bytes in 18.004 files.
Saved approximately 08:03:03:00 by not copying any files.

SyncToy run of ssd-to-vhd (D:\ssd-sync\, E:\vhd-sync\) completed at 31/05/2024 02:22:27.
SyncToy action was 'Echo'.
SyncToy options were:
        Active for run all
        All files included
        Files excluded: *.tmp;.venv;*.git;.DS_Store;Thumbs.db;*.pyc;__pycache__; .idea;.vscode;*.suo;*.user;*.userosscache;*.sln.docstates;*.log;build;dist;node_modules
;*xsync*;*cryptomator*
        Do not check file contents
        Include read-only files
        Do not include hidden files
        Do not include system files
        Backup older files (send to Recycle Bin)
        Some subfolders included
SyncToy run took 00:00:00:012.
Copied 0 bytes in 0 files in 00:00:00:12.
Bytes per second 0,0, files per second 0,0.
Avoided copying 14.491.829.994 bytes in 18.004 files that did not require action.
Saved approximately 08:03:03:00 by not copying all files.

C:\Program Files\SyncToy 2.1\SyncToyCmd.exe exited on LAPTOP-DJH6CVKH with error code 0.

But I have no idea what is the correct syntax to setup on task scheduler action. I can't differentiate which one is the flag for psexec64 and which one is the flag for synctoy. I mean arguments of psexec64 is -s while synctoy is -R. So what the actual argument shall I fill?

enter image description here

2
  • I'm thinking your second call (the executable you want to load remotely, should include its parameters in the doublequotes. eg: ""C:\Program Files\SyncToy 2.1\SyncToyCmd.exe" -R ssd-to-vhd" Commented May 30 at 19:32
  • 1
    another option, if you want to simplify this somewhat, would be to write it in a powershell script or bat file and just call that from task scheduler. Commented May 30 at 23:49

0

You must log in to answer this question.

Browse other questions tagged .