CMD – How do I run a command twice in one line?

How do I display both the host name and boot time? The code I’m trying: systeminfo | find /i "host name" && "boot time" I know I could use systeminfo | find /i "host name" systeminfo | find /i "boot time" but I really don’t want to. Basically I want the command to display the… Read More CMD – How do I run a command twice in one line?

How to use a PowerShell function return as a variable in a batch file

I was trying to use the return from myPowershellScript.ps1 to use as a variable in my batch file. myPowershellScript.ps1 function GetLatestText { return "Hello World" } I was trying to use the For /F function. There may be a better way. myBatch.bat for /f "delims=" %%a in (‘ powershell -command "\\Rossi2\Shared\myPowershellScript.ps1" ‘) do set "var=%%a"… Read More How to use a PowerShell function return as a variable in a batch file

CMD/BATCH BAT SCRIPT How to add digit to file without space

i want to make a start.config file by using bat script. I want to add to my config file that parameter: StartAgents=9 WITHOUT space at the end of line. Unfortunately command: echo StartAgents=9>>C:\start.config not working, I think that there is "collision" with two characters: "9>" Command: echo StartAgents=9 >>C:\start.config is working, but this is adding… Read More CMD/BATCH BAT SCRIPT How to add digit to file without space

C# application with Powershell host

The problem is about sending command to Powershell, My C# application sends commands one by one in order to get right directory to execute some files but even I downloaded all the necessary packages application throws an error An exception of type ‘System.Management.Automation.CommandNotFoundException’ in ‘cd C:\\Users\\User1\\Documents\\pathToFileforExecute\\ ‘ is not recognized as the name of a… Read More C# application with Powershell host

How to create django project

What commands should I write in cmd. When I write: django-admin startproject myproject, it does not create a config folder in my project. What do I miss? >Solution : try using "$ django-admin startproject myproject", the myproject should be the folder that contains your project. If that dosnt work try checking this website: https://www.tutorialspoint.com/django/django_creating_project.htm And… Read More How to create django project

How to fetch the substring from the input string in command prompt

I have the following string set var="/host=the_host/core-service=vault:add(vault-options=[("KEYSTORE_URL" => "C:\wildfly-15.0.1.Final\bin\vault\vault.keystore"),("KEYSTORE_PASSWORD" => "MASK-18BzezESSkb72WrhEf6Rsu"),("KEYSTORE_ALIAS" => "vault"),("SALT" => "1234abcd"),("ITERATION_COUNT" => "120"),("ENC_FILE_DIR" => "C:\wildfly-15.0.1.Final\bin\vault/")])" I want to extract only the MASK-18BzezESSkb72WrhEf6Rsu value alone using windows batch. I have tried using the for but couldn’t find anything to fetch the password alone. >Solution : @ECHO OFF SETLOCAL SET "string=/core-service=vault:add(vault-options=[("KEYSTORE_URL" => "C:\wildfly-8.2.1.Final\bin\vault\vault.keystore"),("KEYSTORE_PASSWORD"… Read More How to fetch the substring from the input string in command prompt