Eureka Moment Wiki

One eureka moment at the time

User Tools

Site Tools


windows:scripting:cmd_shell

Differences

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

Link to this comparison view

Next revision
Previous revision
windows:scripting:cmd_shell [2016/12/19 14:30]
tplecko created
windows:scripting:cmd_shell [2017/08/10 13:00] (current)
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: 2017/08/10 13:00 (external edit)