windows:scripting:cmd_shell

Differences

This shows you the differences between two versions of the page.


windows:scripting:cmd_shell [2019/10/31 09:06] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +====== Script to modify CMD prompt ======
 +to "username@computername architecture path" and a $ if run as admin, and > if not run as admin
 +<code bash |Cmd>@echo off
 +set P1=%USERNAME%@%COMPUTERNAME%
  
 +if "%PROCESSOR_ARCHITECTURE%" == "AMD64" (
 +    set P2= x64 $P
 +) else (
 +    set P2= x86 $P
 +)
 +
 +net session >nul 2>&1
 +if %errorLevel% == 0 (
 +  set P3=$$
 +) else (
 +  set P3=$G
 +)
 +
 +set P4= 
 +
 +prompt %P1%%P2%%P3%%P4%</code>
  • windows/scripting/cmd_shell.txt
  • Last modified: 2019/10/31 09:06
  • by 127.0.0.1