Difference between revisions of "Command Line"

From Max's Wiki
Jump to navigation Jump to search
Line 4: Line 4:
 
===Remove:===
 
===Remove:===
  
* runas /user:admin@DOMAIN cmd
+
runas /user:admin@DOMAIN cmd
* wmic
+
wmic
* /node:"%COMPUTERNAME%" product get name,version,vendor
+
/node:"%COMPUTERNAME%" product get name,version,vendor
* /node:"%COMPUTERNAME%" product where name="Adobe Acrobat XI Pro"
+
/node:"%COMPUTERNAME%" product where name="Adobe Acrobat XI Pro"
* /node:'%COMPUTERNAME%' product where name="Adobe Acrobat XI Pro" call uninstall /nointeractive
+
/node:'%COMPUTERNAME%' product where name="Adobe Acrobat XI Pro" call uninstall /nointeractive
  
 
==Install:==
 
==Install:==
* copy %COMPUTERNAME% "\\servername\software\AdbeRdr11000_mui_Std" "C:\IT-DATA"
+
copy %COMPUTERNAME% "\\servername\software\AdbeRdr11000_mui_Std" "C:\IT-DATA"
* psexec %COMPUTERNAME% msiexec /i "C:\IT-DATA\AdbeRdr11000_mui_Std\AcroRead.msi" EULA_ACCEPT=YES REMOVE_PREVIOUS=YES /quiet /norestart
+
psexec %COMPUTERNAME% msiexec /i "C:\IT-DATA\AdbeRdr11000_mui_Std\AcroRead.msi" EULA_ACCEPT=YES REMOVE_PREVIOUS=YES /quiet /norestart
 
''[http://community.spiceworks.com/how_to/179-using-a-command-line-to-uninstall-software-on-remote-pcs Source]''
 
''[http://community.spiceworks.com/how_to/179-using-a-command-line-to-uninstall-software-on-remote-pcs Source]''
  
 
==Install MSI Remotely==
 
==Install MSI Remotely==
psexec -s \\COMPUTERNAME msiexec /i \\PATHTOMSI.msi /qn
+
psexec -s \\COMPUTERNAME msiexec /i \\PATHTOMSI.msi /qn
  
 
==WMIC==
 
==WMIC==
 
===View Security Identifier (SID)===
 
===View Security Identifier (SID)===
wmic useraccount get name,sid
+
wmic useraccount get name,sid
  
 
===View Current Logged On User===
 
===View Current Logged On User===
wmic /node:"COMPUTERNAME" computersystem get username
+
wmic /node:"COMPUTERNAME" computersystem get username
  
 
===View Serial Number===
 
===View Serial Number===
wmic /node: "COMPUTERNAME" SystemEnclosure get SerialNumber  
+
wmic /node: "COMPUTERNAME" SystemEnclosure get SerialNumber  
 
+
wmic /node: "WOMPUTERNAME" BIOS get SerialNumber
wmic /node: "WOMPUTERNAME" BIOS get SerialNumber
 
  
 
==View Motherboard Manufacturer, Product, Serial Number==
 
==View Motherboard Manufacturer, Product, Serial Number==
wmic baseboard get product,Manufacturer,version,serialnumber
+
wmic baseboard get product,Manufacturer,version,serialnumber
  
 
===View Installed RAM===
 
===View Installed RAM===
  
wmic MEMORYCHIP get BankLabel,DeviceLocator,Capacity,Speed
+
wmic MEMORYCHIP get BankLabel,DeviceLocator,Capacity,Speed
  
 
===View Remote Registry===
 
===View Remote Registry===
* sc \\computername start remoteregistry start= auto
+
sc \\computername start remoteregistry start= auto
* copy and paste it into notepad
+
copy and paste it into notepad
* save it as .bat
+
save it as .bat
  
 
===View System Uptime===
 
===View System Uptime===
 
  systeminfo | find "Time"
 
  systeminfo | find "Time"

Revision as of 17:52, 26 May 2017

Uninstall an Application or Program Remotely

Remove:

runas /user:admin@DOMAIN cmd
wmic
/node:"%COMPUTERNAME%" product get name,version,vendor
/node:"%COMPUTERNAME%" product where name="Adobe Acrobat XI Pro"
/node:'%COMPUTERNAME%' product where name="Adobe Acrobat XI Pro" call uninstall /nointeractive

Install:

copy %COMPUTERNAME% "\\servername\software\AdbeRdr11000_mui_Std" "C:\IT-DATA"
psexec %COMPUTERNAME% msiexec /i "C:\IT-DATA\AdbeRdr11000_mui_Std\AcroRead.msi" EULA_ACCEPT=YES REMOVE_PREVIOUS=YES /quiet /norestart

Source

Install MSI Remotely

psexec -s \\COMPUTERNAME msiexec /i \\PATHTOMSI.msi /qn

WMIC

View Security Identifier (SID)

wmic useraccount get name,sid

View Current Logged On User

wmic /node:"COMPUTERNAME" computersystem get username

View Serial Number

wmic /node: "COMPUTERNAME" SystemEnclosure get SerialNumber 
wmic /node: "WOMPUTERNAME" BIOS get SerialNumber

View Motherboard Manufacturer, Product, Serial Number

wmic baseboard get product,Manufacturer,version,serialnumber

View Installed RAM

wmic MEMORYCHIP get BankLabel,DeviceLocator,Capacity,Speed

View Remote Registry

sc \\computername start remoteregistry start= auto
copy and paste it into notepad
save it as .bat

View System Uptime

systeminfo | find "Time"