Using SSH to run afterfx.exe with script (-s) fails
Copy link to clipboard
Copied
I've been trying to run afterfx.exe on a remote computer, using SSH.
SSH works well (Windows 10 on both client & server), authentication is with private/public keys.
Running the app seems to work (as a backgroung process in the remote computer), however, adding the script tag (-s) doesn't work.
Example:
ssh user@my-remote-computer start afterfx -s "app.project.save(new File('c:/temp/newSavedFile.aep'))"
I've tried different versions using quotes and escaped quotes, still nothing. Also changing "start afterfx" to the app's complete path & filename, didn't help.
Has anyone experienced issues using SSH?
Thanks!
Copy link to clipboard
Copied
Windows is a super paranoid operating system. It's frenetic. It likely won't let you do this because of implemented security measures.
Good news! You can use PsExec to circumvent many of these security issues. With PsExec you can have a remote process launch with an "Elevated Security Token" which is a nerdy way to say you can launch the process as an admin even if you are remote.
I don't have the exact incantation, but it is possible to do what you want. You just need to use username / password of an admin user and then user the elevated token flag:
https://docs.microsoft.com/en-us/sysinternals/downloads/psexec
You also want to make sure that PsExec "interacts with the UI"
Good luck and godspeed!
Copy link to clipboard
Copied
Thanks @Arie Stavchansky for the fast reply!
I've tried PSEXEC as well, it looked promising (though a bit tricky if you don't use the same user on the client and remote machines) - so I can invoke afterfx as a background process, however passing the script argument (-s or -r) results in nothing..
I've tried dozens of character escape variations for the quotes (double quote, ^", \" and also win-dos cli combinations with %variables%), no success either.
I currently trying to get it working through Powershell - maybe it can offer a better way to send a complete command + arguments.
Copy link to clipboard
Copied
Yaron,
What is the exact PsExec incantation that you have tried? I want to see all the flags / switches you've used in your efforts.
Ultimately, you may want to reconsider your architecture, though. What you should really be doing is create some kind of script on the remote machine (the server) that handles the actual launching of After Effects, and then use some kind of server technology to "wait" for a signal from the client machine to start the process. That is, use something like ExpressJS (NodeJS) or Laravel (PHP) on the server to launch AE directly on the (server) — then expose a server endpoint that executes the code that handles the launching. Then, on the client app, just interface with the exposed end point. Logging into the remote machine via SSH and launching it as if you are tunneling into that machine is not ideal and not really scalable as you will likely want more client apps.
To win with Windows you must be a Jedi — never give up! What your elementary school teacher failed to convey is that dealing with Windows is one of the most difficult things you will ever do in life and will steal time away from your loved ones. My best to you because I know the pain you are experiencing. The joy you will gain from overcoming this hurdle will be unspeakable and no one will know the satisfaction you will ultimately feel once you acheive your goal!
🙂
Copy link to clipboard
Copied
Hi Arie,
Thanks for the encouragment hhh :-), winning with Windows is a real challange..
So, my current solution with SSH (worked better for me than PSEXEC), was running a command batch file at the AE machine, which in place runs AE and forwards the batch file arguments to it, somthing like:
(Client)
SSH username@hostname c:/mypath/runafter.bat "param1"
(AE machine)
start /wait afterfx -s %1%
The /wait option keeps AE from shutting down immediately.
I would say going down the ssh/psexec path was because of trying to install and maintain a little code/app as possible in the AE machine - as future scaling will be on the AE machine instances, not the client. It also looked more secure.
BUT, following your advice and re-evaluating the my use-case, I found a great solution by Adobe - using hidden CEP panel with a node-based http-server in it - and the using CSInterface library to control AE:
Which is AWESOME!!
It requires some setup, and I need to take care of security myself, yet it is simple, straight forward solution for continous control of AE machine.
Copy link to clipboard
Copied
You could probably get it to work with a ton of manual changes like fiddling with the security certificates and policies, but in the long run I'd simply use a commercial VPN/ remote access software. Depending how your scripts eveolve the interactions of some functions could simply become too complex, anayway and eventually you'll spend more time fixing access and security stuff than actualyl getting work done.
Mylenium
Copy link to clipboard
Copied
Thanks @Mylenium for the fast response,
I forgot to mention that my final goal is an automated process with after-effects, invoked by an application server, so I'm trying to get it working without any user interaction. The client and remote computers are both under VPN / same network.

