agent exec api windows command problem

berkcekisbas

New Member
Jan 9, 2023
2
0
1
hello, you are having a problem with the api, you can help.

I am trying to send a terminal command to windows on agent.

https://pve.proxmox.com/pve-docs/api-viewer/#/nodes/{node}/qemu/{vmid}/agent/exec

data = [
'command' = "cmd.exe dir"
]

I don't know the parameters.

I want to create a directory, get the directory list, create a txt document, in short, run cmd operations and powershell commands.

Can you give me an example of the commands on the rest api?

Thank you.
 
data = [
'command' = "cmd.exe dir"
]

I don't know the parameters.
When using guest agent exec on Linux, I noticed that the command is only the executable (cmd.exe in your case) and everything else is a separate parameter (dir in your case). It does not automatically split commands and arguments on spaces for you.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!