agent exec api windows command problem

berkcekisbas

Member
Jan 9, 2023
2
0
6
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.