First, some hints to Prac 3.Task 3.2

Similar documents
Password Reset Utility. Configuration

Sample Application: Frequency of words in text

Multiple.minecraft file Organiser + Backuper - Batch File

Lab - Common Windows CLI Commands

In this tutorial we will discuss different options available in the Options tab in EMCO Network Inventory 4.x.

Configuring Embedded LDAP Authentication

SETTING UP THE CLUB PC FOR OPTIMUM EASE OF USE

Rainbow Desktop app Per-user MSI deployment using Microsoft Active Directory Group Policy Objects (AD-GPO)

Security Removable Media Manager

Windows Command-Line: The Personal Trainer. Windows 8.1, Windows Server 2012 & Windows Server 2012 R2. William Stanek

Security Removable Media Manager

Start Plink SSH tunnel on Windows start - Windows Resource Kit and AlwaysUp start Windows services when computer boots up

HOWTO install multiple Sybase ASE or RS versions on a Windows server Contents

Manual Script Windows Batch For Loop Files In A Directory

MonitorPack Guard deployment

Skype For Business(Windows) Getting Started

Conventions in this tutorial

Microsoft Official Academic Course Windows Vista Configuration, Exam ISBN: ERRATA

All Microsoft Dos Commands

Automation Engine Scripting Samples

COPYRIGHT NOTICE Vyooh Low Level Computing LLP. All Rights Reserved.

Touch Dynamic Quest II 7 - Tablet Staging Setup

AppWizard Installation/Upgrade Guide (v.4.00)

Manual Script Windows Batch If Condition. Syntax >>>CLICK HERE<<<

Overview. Program Start VB SCRIPT SIGNER. IT Services

Monitoring Windows Systems with WMI

5.4.8 Optional Lab: Managing System Files with Built-in Utilities in Windows Vista

Remote Access User Guide for Mac OS (Citrix Instructions)

Installing Access Manager Agent for Microsoft SharePoint 2007

Manually Open Windows Task Manager Xp Run As Administrator

Backup using Quantum vmpro with Symantec Backup Exec release 2012

NETWRIX PASSWORD EXPIRATION NOTIFIER

Windows 7 Manually Install Network Printer Drivers Without Admin Rights Gpo

[Outlook Configuration Guide]

From using an External Harddrive, to a Google Cloud Drive; there is no one way to backup data.

application components

Windows Based Open Terminal Multi-Version Installation and Setup with SAM2. With Squirrel Version 6.0+ September 18, 2012

Yong Peng High School System Documentation PC Section

Drupal Command Line Instructions Windows 7 List All Printers

Chgport The chgport command can be used to display or change COM port mappings for DOS compatibility.. Chgusr The chgusr command is used to change the

Print Audit 6. Print Audit 6 Documentation Apr :07. Version: Date:

Print Station. Point-and-Click Printing WHITE PAPER

WA2592 Applied Data Science and Big Data Analytics. Classroom Setup Guide. Web Age Solutions Inc. Copyright Web Age Solutions Inc.

Assignment clarifications

Instruction How To Use Printer Processing >>>CLICK HERE<<<

Manually Run Ad Logon Script As Administrator Group Policy

INF204x Module 1, Lab 3 - Configure Windows 10 VPN

5.4.8 Lab: Managing System Files with Built-in Utilities in Windows XP

Java Trojan UDURRANI UDURRANI

ADSelfService Plus Client Software Installation via Group Policy Objects (GPOs)

HOW TO DISABLE OR STOP AUTO CHKDSK DURING WINDOWS STARTUP

Centurion Technologies

Installing and Using Document Distributor

CorreLog. LDAP Interface Software Toolkit Users Manual

Software Installation for CS121

WMI log collection using a non-admin domain user

QUICK START GUIDE PRINT MANAGER PLUS RELEASE STATION Software Shelf Computer Software. Take Control of Your Network Printing

Microsoft. Microsoft. Course 20688D: Supporting Windows 8.1. Level : 200 Technology : Windows 8 Delivery Method : Instructor-led (classroom)

Copyright 2018, fp Technologies, Inc. of Ohio All Rights Reserved. filepro Installation Windows (Versions 7, 10 and Server Editions)

Introduction to the shell Part II

This document is intended to help you connect to the CVS server on a Windows system.

Cloudamize vcenter Agent Installer

edp 8.2 Info Sheet - Integrating the ediscovery Platform 8.2 & Enterprise Vault

Daniel Frome Senior System and Database Administrator III

Install Telepresence Content Server License Key(s)

User Agent Preparing the Windows Environment and Installing the User Agent. How-To

Basic Shell Scripting Practice. HPC User Services LSU HPC & LON March 2018

Remove Windows Service Manually Command Line Scheduler

Abaqus Student Edition. Installation Instructions

Manual Script Windows Batch If Condition. Statement Example >>>CLICK HERE<<<

WA2393 Data Science for Solution Architects. Classroom Setup Guide. Web Age Solutions Inc. Copyright Web Age Solutions Inc. 1

RAP as a Service for Dynamics AX

EMS.WASTE SFS Chemical Safety, Inc. All Rights Reserved Page 1

UNIX Essentials Featuring Solaris 10 Op System

INTEGRATING WITH DELL CLIENT COMMAND SUITE: VMWARE WORKSPACE ONE OPERATIONAL TUTORIAL VMware Workspace ONE

Delete Offline Address Book Outlook 2010 Windows Xp

Network+ LAB Name. Lab 1a: MS Win 2000/2003/2008 Server Installation

Installation & Configuration Guide

JNIOR Support Tool Release Notes

Introduction p. 1 Who Should Read This Book? p. 1 What You Need to Know Before Reading This Book p. 2 How This Book Is Organized p.

Virginia Western Community College ITN 110 Client Operating System (Windows 10)

Perl and R Scripting for Biologists

Drupal Command Line Instructions Windows 7 Network Drive >>>CLICK HERE<<<

Office 365 for IT Pros

How to create a System Logon Account in Backup Exec for Windows Servers

Managing the Startup Folder in Windows 8

Addoro Local 3.0. Installation and Configuration

Unified Write Filter Configuration

Introduction to Supercomputing

If you are currently using a beta version of EPIC that is prior to 4.56 then you need to upgrade to version 5.00.

WA2342 NoSQL Systems Comparison. Lab Server VM Setup Guide. Web Age Solutions Inc. Copyright Web Age Solutions Inc. 1

EASYLABEL Net Print Server

Deploying Lightspeed User Agent v

Scalability of Office Suites on Terminal Servers

Creating Android Apps from Rh10

Batch Eligibility Long Term Care claims

Application Note: Installing Remote Management Agents Using Service Account Manager Rev 2 June 1, 2006

Installing and configuring an Android device emulator. EntwicklerCamp 2012

Web Client for Windows

CITRIX 1Y0-200 EXAM QUESTIONS & ANSWERS

Transcription:

First, some hints to Prac 3.Task 3.2 Prac 3.Task 3.2: retrieve Domain name, Computer name, and User name Domain name, Computer name, and User name (currently logged on as a user are different concepts. See the output below: /* retrieve Domain name, Computer name, and User name */ Set onetwork = CreateObject("WScript.Network" strdomain = onetwork.userdomain ' set objdomain = GetObject("WinNT://" & strdomain strcomputer = onetwork.computername ' set objcomputer = GetObject("WinNT://" & strcomputer ' objcomputer.getinfo struser = onetwork.username WScript.echo "Domain name: " & strdomain & VbCr & "Computer name: " _ & strcomputer & VbCr & "User name: " & struser Multiple accounts can be created on a computer or different users can logon to the same machine. The Domain name and Computer name are kept unchanged, while the User name changes with different accounts. Domain name means a User Group; Computer name is to identify a terminal; User name is for individual account who logs on the machine.

But on a personal computer without group settings, Domain name and Computer name could be the same: Computer Name can be typically found by right-clicking My Computer, then click Properties, then tab the Computer Name. Computer Name should have a corresponding IP address (in the setting of IP protocol.

We now introduce some systems administration tasks by using the Windows batch files. These are for your information only. 1. Windows startup programs can be managed via different ways. For your interest only. 1 Using UI utilities e.g. Run msconfig.exe program or search 'system configuration' and then start it.

Switch to Startup tab, you can freely enable or disable a program's auto-launch at Windows startup 2 Using commandline script (batch operations or vbs etc to touch the Windows registry directly Here are listed all startup programs for local computer: [HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run] And here are listed all startup programs for current user: [HKCU\Software\Microsoft\Windows\CurrentVersion\Run] For instance, in order to disable Skype auto-launch at Windows startup, you can run the command: reg delete HKCU\Software\Microsoft\Windows\CurrentVersion\Run /v Skype /f

2. Create directory structure of installed application This is for your interest only. Source at http://www.catonrug.net/, where search for "Create directory structure of installed application". Type in the following code and name it as CreateDirStructureInstalledApplications.cmd. Please note that, running this batch file requires auxiliary utilities in the SAP auxiliary utilities.zip; unzip it place all files in the same working folder as CreateDirStructureInstalledApplications.cmd. This code will list all program names into folders; inside each folder, a log file %computername%.log will be created; inside the log file there will be version number of application. @echo off setlocal EnableDelayedExpansion set path=%path%;%~dp0 set l=%~dp0 set u=microsoft\windows\currentversion\uninstall if "%ProgramFiles(x86%"=="" ( set sw=hklm\software set tokens=7 goto x86 :x64 echo 64-BIT APPS: set sw=hklm\software set tokens=7 for /f "tokens=%tokens% delims=\" %%a in ('^ reg query "%sw%\%u%" ^ grep "CurrentVersion.*Uninstall"' do ( reg query "%sw%\%u%\%%a" /v DisplayName > nul 2>&1 if!errorlevel!==0 ( reg query "%sw%\%u%\%%a" /v DisplayName > nul 2>&1 if!errorlevel!==0 for /f "tokens=*" %%b in ('^ reg query "%sw%\%u%\%%a" /v DisplayName ^ grep "DisplayName" ^ sed "s/reg_sz\ DisplayName//g" ^ sed "s/^[ \t]*//g"' do if not %%b=="" set name=%%b reg query "%sw%\%u%\%%a" /v DisplayVersion > nul 2>&1 if!errorlevel!==0 for /f "tokens=*" %%c in ('^ reg query "%sw%\%u%\%%a" /v DisplayVersion ^ grep "DisplayVersion" ^ sed "s/reg_sz\ DisplayVersion//g" ^ sed "s/^[ \t]*//g"' do if not %%c=="" set version=%%c echo!name!!version! if not exist "%l%\!name!" md "%l%\!name!" echo!version! > "%l%\!name!\%computername%.log"

set sw=hklm\software\wow6432node set tokens=8 :x86 echo 32-BIT APPS: for /f "tokens=%tokens% delims=\" %%a in ('^ reg query "%sw%\%u%" ^ grep "CurrentVersion.*Uninstall"' do ( reg query "%sw%\%u%\%%a" /v DisplayName > nul 2>&1 if!errorlevel!==0 ( reg query "%sw%\%u%\%%a" /v DisplayName > nul 2>&1 if!errorlevel!==0 for /f "tokens=*" %%b in ('^ reg query "%sw%\%u%\%%a" /v DisplayName ^ grep "DisplayName" ^ sed "s/reg_sz\ DisplayName//g" ^ sed "s/^[ \t]*//g"' do if not %%b=="" set name=%%b reg query "%sw%\%u%\%%a" /v DisplayVersion > nul 2>&1 if!errorlevel!==0 for /f "tokens=*" %%c in ('^ reg query "%sw%\%u%\%%a" /v DisplayVersion ^ grep "DisplayVersion" ^ sed "s/reg_sz\ DisplayVersion//g" ^ sed "s/^[ \t]*//g"' do if not %%c=="" set version=%%c echo!name!!version! if not exist "%l%\!name!" md "%l%\!name!" echo!version! > "%l%\!name!\%computername%.log" endlocal

3. Howto systeminfo For your interest only. Source at http://www.catonrug.net/. Of course you can check the system information from the Control Panel. However, you can also use command script to automatically retrieve the system information. Type in the following code and name it as howtosysteminfo.cmd. Please note that, running this batch file requires auxiliary utilities in the SAP auxiliary utilities.zip. Unzip it place all files in the same working folder as howtosysteminfo.cmd. Then run howtosysteminfo.cmd and retrieve the system info. @echo off setlocal EnableDelayedExpansion set path=%path%;%~dp0 set tab= systeminfo awk "/Host Name/;/OS Name/;/System Model/;/System Type/;/Total Physical Memory/" echo Locally installed printers: for /F "tokens=7 delims=\" %%p in ('^ reg query "HKLM\SYSTEM\CurrentControlSet\Control\Print\Printers"' do echo %tab%%%p ipconfig all grep v "^$" reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName ^ find "Windows XP" > nul 2>&1 if not!errorlevel!==0 set r=/r gpresult %r% /user DOMAINNAME\% username% endlocal pause

4. Kill process in windows This may be useful during the lab. I'm not sure whether we are allowed to copy nircmd.exe to %systemroot%\system32 on lab computers though. If not, ignore this activity. Copy nircmd.exe to %systemroot%\system32. Then you can use the command like this: nircmd killprocess Wscript.exe nircmd killprocess javaw.exe

5. List installed programs in cmd window For your interest only. Source at http://www.catonrug.net/ Type in the following code and name it as ListInstalledPrograms.cmd, then run it. It may take a short while to retrieve the information. You can also redirect the output to a file. @echo off setlocal EnableDelayedExpansion set U=Microsoft\Windows\CurrentVersion\Uninstall set dn=displayname set pdn=parentdisplayname set dv=displayversion if exist "%temp%\pcx64.log" del "%temp%\pcx64.log" if exist "%temp%\pcx86.log" del "%temp%\pcx86.log" if "%ProgramFiles(x86%"=="" ( set SW=HKLM\SOFTWARE set tokens=7 goto x86 :x64 echo 64-BIT APPS: set SW=HKLM\SOFTWARE set tokens=7 FOR /F "tokens=%tokens% delims=\" %%A IN ('reg query "%SW%\%U%"' DO ( reg query "%SW%\%U%\%%A" /v %dn% > nul 2>&1 if!errorlevel!==0 ( reg query "%SW%\%U%\%%A" find /V "%pdn%" find "%dn%" > nul 2>&1 if!errorlevel!==0 echo %%A; >> "%temp%\pcx64.log" for /F "tokens=1 delims=;" %%A in ('type "%temp%\pcx64.log"' do ( echo %%A reg query "%SW%\%U%\%%A" /v "%dn%" find "%dn%" reg query "%SW%\%U%\%%A" /v "%dv%" > nul 2>&1 if!errorlevel!==0 reg query "%SW%\%U%\%%A" /v "%dv%" find "%dv%" set SW=HKLM\SOFTWARE\Wow6432Node set tokens=8

:x86 echo 32-BIT APPS: FOR /F "tokens=%tokens% delims=\" %%A IN ('reg query "%SW%\%U%"' DO ( reg query "%SW%\%U%\%%A" /v %dn% > nul 2>&1 if!errorlevel!==0 ( reg query "%SW%\%U%\%%A" find /V "%pdn%" find "%dn%" > nul 2>&1 if!errorlevel!==0 echo %%A; >> "%temp%\pcx86.log" for /F "tokens=1 delims=;" %%A in ('type "%temp%\pcx86.log"' do ( echo %%A reg query "%SW%\%U%\%%A" /v "%dn%" find "%dn%" reg query "%SW%\%U%\%%A" /v "%dv%" > nul 2>&1 if!errorlevel!==0 reg query "%SW%\%U%\%%A" /v "%dv%" find "%dv%" endlocal

6. Prompt for numbers in windows batch file For your interest only. Source at http://www.catonrug.net/ Type in the following code and name it as promptnumbers.cmd, then run it. @echo off echo Hello. Lets make a sum of two numbers. set /p first=type a first number: set /p second=type a second number: set /a together=first+second echo %together% pause