---
title: llarp::win32::OneShotExec
summary: RAII wrapper for calling a subprocess in win32 for parallel executuion in the same scope destructor blocks until timeout has been hit of the execution of the subprocses finished. 

---

# llarp::win32::OneShotExec



RAII wrapper for calling a subprocess in win32 for parallel executuion in the same scope destructor blocks until timeout has been hit of the execution of the subprocses finished. 


`#include <exec.hpp>`

## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[OneShotExec](Classes/classllarp_1_1win32_1_1OneShotExec.md#function-oneshotexec)**(std::string exe, std::string args, std::chrono::milliseconds timeout =5s)<br>construct a call to an exe in system32 with args, will resolve the full path of the exe to prevent path injection  |
| | **[~OneShotExec](Classes/classllarp_1_1win32_1_1OneShotExec.md#function-~oneshotexec)**() |

## Public Functions Documentation

### function OneShotExec

```cpp
explicit OneShotExec(
    std::string exe,
    std::string args,
    std::chrono::milliseconds timeout =5s
)
```

construct a call to an exe in system32 with args, will resolve the full path of the exe to prevent path injection 

### function ~OneShotExec

```cpp
~OneShotExec()
```


-------------------------------

Updated on 2023-01-20 at 23:19:39 +0000