What to make a program to interact with Windows CMD?

I need to make a simple program that will execute commands in cmd. What could this be done?

Specifically the scheme is:
I have harvested .cmd files, which I give rights to folders to users through the utility Cacls

cacls D:\Folder /E /G Domain\User1:C, Domain\User2:R

That is, the program will have to be
input for folder "D\Folder"
input or a checkbox/radio for arguments "/E /G"
input for user "Domain\User1:C, Domain\User2:R"
button "Run"

And it is also desirable that the process performed in the command line are displayed in some additional mini-window of this program

From my skills of writing code - reworked the crutches on JS a web page for themselves, customized feedback form in PHP to fit your needs

What is realize?
Folders very much, exactly like users. Everyone has their own right. Regularly something changes.
To do it via folder Properties - Security, extremely long. Using group policy was also not fast
April 19th 20 at 12:08
2 answers
April 19th 20 at 12:10
To create a graphical interface can be used, for example, https://ru.wikipedia.org/wiki/HTML_Application
<textarea id=output></textarea>
<script language=JScript>
var WshShell = new ActiveXObject('WScript.Shell');
var WshExec = WshShell.Exec("cmd /c 2>&1 cacls D:\Folder /E /G Domain\User1:C, Domain\User2:R");
document.getElementById('output').value = WshExec.StdOut.ReadAll();
Thank you. That's about what it is turned.


the <head>
 <title>Access Changer</title>
 <meta charset="utf-8">
 <script language=javascript>
 var winWidth = 450;
 var winHeight = 328;
 window.resizeTo(winWidth, winHeight);
 var winPosX = screen.width / 2 - winWidth / 2;
 var winPosY = screen.height / 2 - winHeight / 2;
 window.moveTo(winPosX, winPosY);

 <script language=javascript>
 icacls function() {
 var shell = new ActiveXObject("WScript.shell");
 var path = document.getElementById("path").value;
 if (path == "") {
 slash = ""
 } else {
 slash = "\\"
 var user = document.getElementById("user").value;
 var rights = document.getElementById("rights").value;
 var command = "cmd /c icacls \"D:\\Folder" + slash + path + "\" /grant:r \"Domain\\" + user + "\":" + rights + "/T";
 * {
 border: none;
 margin: 0;
 padding: 0;

 body {
 background: #000;
 margin: 16px;

 h2 {
 color: #fff;
 font-family: Tahoma;
 font-size: 16px;
 line-height: 32px;

 .wrapper {
 border: solid 1px #fff;
 height: 256px;
 padding: 16px;
 width: 400px;

 .wrapper input {
 width: 200px;

 .wrapper p {
 color: #909090;
 padding-right: 16px;
 text-align: right;

 .wrapper h2 {
 padding-left: 150px;
 text-align: left;

 .push {
 background: #1010D0;
 border: solid 1px #fff;
 color: #fff;
 display: block;
 margin-top: 32px;
 margin-left: 84px;
 text-align: center;
 width: 200px;

the <body>
 <div class="wrapper">
 <input type="text" id="path" />
 <input type="text" id="user" />
 <input type="text" id="rights" />
 <input type="button" class="push" value="Give Access" onclick="icacls()" />

- Casey85 commented on April 19th 20 at 12:13
April 19th 20 at 12:12
Input you can do the same in the batch file with
set /p
See: set /?
By the way, when cmd is hanging on the input to set /p there can be the mouse to drag directories/files from Windows Explorer, it is quite convenient.
But given that many directories, it makes sense to just make a text file in which, in a format to score the user settings and rights for each desired folder in the batch file to read the file and execute cacls.

Find more questions by tags cmd/bat