SlideShare une entreprise Scribd logo
1  sur  35
Télécharger pour lire hors ligne
Tool Development
Chapter 08: Windows Command Prompt
Nick Prühs
Assignment Solution #7
DEMO
2 / 58
Objectives
• To understand how to interact with the Windows
command prompt
• To learn how to create tool chains by creating new
processes in .NET
3 / 58
Windows Commands
4 / 58
Command Description
Attrib Displays, sets, or removes attributes assigned to files or directories.
Cd Displays the name of or changes the current directory.
Cls Clears the Command Prompt window.
Copy Copies one or more files from one location to another.
Del Deletes one or more files.
Dir Displays a list of a directory's files and subdirectories.
Echo Displays messages or turns on or off the command echoing feature.
Md Creates a directory or subdirectory.
Move Moves one or more files from one directory to another directory.
Rd Deletes a directory.
Xcopy Copies files and directories, including subdirectories.
Attrib Command
Displays, sets, or removes attributes assigned to files
or directories.
Syntax:
attrib [{+|-}r] [{+|-}h] [<Drive>:][<Path>][<FileName>] [/s [/d]]
5 / 58
Cd Command
Displays the name of or changes the current
directory.
Syntax:
cd [<Drive>:][<Path>]
cd [..]
6 / 58
Cls Command
Clears the Command Prompt window.
Syntax:
cls
7 / 58
Copy Command
Copies one or more files from one location to
another.
Syntax:
copy [/y] <Source> [+<Source> [+ ...]] [<Destination>]
8 / 58
Del Command
Deletes one or more files.
Syntax:
del [/s] <Names>
9 / 58
Dir Command
Displays a list of a directory's files and subdirectories.
Syntax:
dir [<Drive>:][<Path>][<FileName>] [/p] [/a[[:]<Attributes>]] [/s]
10 / 58
Echo Command
Displays messages or turns on or off the command
echoing feature.
Syntax:
echo [<Message>]
echo [on | off]
11 / 58
Md Command
Creates a directory or subdirectory.
Syntax:
md [<Drive>:]<Path>
12 / 58
Move Command
Moves one or more files from one directory to
another directory.
Syntax:
move [<Source>] [<Target>]
13 / 58
Rd Command
Deletes a directory.
Syntax:
rd [<Drive>:]<Path> [/s]
14 / 58
Xcopy Command
Copies files and directories, including subdirectories.
Syntax:
Xcopy <Source> <Destination> [/q] [/s] [/h]
15 / 58
Command Prompt Wildcards
Used to represent one or more characters when you
are searching for files, folders, printers, computers,
or people.
16 / 58
Wildcard character Description
Asterisk (*) Substitute for zero or more characters.
Question mark (?) Substitute for a single character in a name.
Windows Batch Files
• Unformatted text file that contains one or more
commands and has a .bat file name extension.
• Allows you to simplify routine or repetitive tasks.
• When you type the file name at the command
prompt, Cmd.exe runs the commands sequentially
as they appear in the file.
17 / 58
Batch File Parameters
• Cmd.exe provides the batch parameter expansion
variables %0 through %9.
• %0 is replaced by the batch file name.
• %1 through %9 are replaced by the corresponding
arguments that you type at the command line.
18 / 58
Command Redirection
Operators
19 / 58
Redirection operator Description
> Writes the command output to a file or a device, such as a printer,
instead of the Command Prompt window.
< Reads the command input from a file, instead of reading input from the
keyboard.
>> Appends the command output to the end of a file without deleting the
information that is already in the file.
| Reads the output from one command and writes it to the input of
another command. Also known as a pipe.
Batch File Commands
20 / 58
Command Description
If Performs conditional processing in batch programs.
Goto Within a batch program, redirects to a line identified by a label.
Rem Enables you to include comments (remarks) in a batch file or in your configuration files.
If Command
Performs conditional processing in batch programs.
Syntax:
if [not] errorlevel number command [else expression]
if [not] string1==string2 command [else expression]
if [not] exist FileName command [else expression]
21 / 58
Goto Command
Within a batch program, redirects to a line identified
by a label.
Syntax:
goto label
:label
22 / 58
Rem Command
Enables you to include comments (remarks) in a
batch file or in your configuration files.
Syntax:
rem [comment]
23 / 58
Command-Line Paramters
in .NET
Application Type Parameter Access
Console Application static void Main(string[]
args)
WPF Application StartupEventArgs of the Startup
event handler
General Environment.GetCommandLineArg
s();
24 / 58
Command-Line Paramters
in .NET
C#
25 / 58
public static void Main(string[] args)
{
// Print all parameters to the console.
foreach (var arg in args)
{
Console.WriteLine(arg);
}
}
Starting Programs in .NET
• Process class is a useful tool for starting, stopping,
controlling, and monitoring applications
• You can obtain a list of the processes that are
running, or you can start a new process
• After a Process has been initialized, it can be used
to obtain information about the running process
• set of threads
• loaded modules (.dll and .exe files)
• amount of memory the process is using
26 / 58
Starting Programs in .NET
• The operating system persists the process handle,
which is accessed through the Handle property of
the Process component, even when the process has
exited.
• Thus, you can get the process's administrative
information, such as the ExitCode and
the ExitTime.
27 / 58
Starting Programs in .NET
C#
28 / 58
// Create new process object.
Process process = new Process();
// Set target file and command-line arguments.
process.StartInfo.FileName = "ParameterDemo.exe";
process.StartInfo.Arguments = "/s";
// Start process.
process.Start();
Starting Programs in .NET
C#
29 / 58
// Create new process object.
Process process = new Process();
// Set target file. Windows will automatically open the file with the default program.
process.StartInfo.FileName = "textfile.txt";
// Start process.
process.Start();
Assignment #8
1. Title Bar – Map File Name
1. Keep the file stream of the current map file open until
a new map is created or opened.
2. Update the title of the main window, always showing
the name of the current map file.
30 / 58
Assignment #8
2. Save to Current File
1. Add a Save menu item to the File menu of the Main
Window, and change the Save As toolbar button to a
Save toolbar button.
2. Executing the Save command should write the current
map data to the current map file, if any, and open the
Save As dialog otherwise.
31 / 58
Assignment #8
3. Title Bar – Modified Asterisk
Update the title of the main window, showing an asterisk
after the current map file name while the map is dirty.
32 / 58
References
• Microsoft. Command-Line Reference.
http://technet.microsoft.com/en-
us/library/cc754340.aspx, November 23, 2015.
• Microsoft. Using batch files.
https://www.microsoft.com/resources/documentat
ion/windows/xp/all/proddocs/en-
us/batch.mspx?mfr=true, May 2016.
• Microsoft. Using wildcard characters.
http://technet.microsoft.com/en-
us/library/bb490639.aspx, May 2016.
33 / 58
Thank you!
http://www.npruehs.de
https://github.com/npruehs
@npruehs
dev@npruehs.de
5 Minute Review Session
• Which wildcards are available at the windows
command prompt?
• How do you access parameters in batch files?
• Which redirection operator writes the command
output to a file or a device instead of the Command
Prompt window?
• How do you access command-line parameters in
.NET?
• How do start other programs from your .NET
application?
35 / 58

Contenu connexe

Tendances

intro unix/linux 09
intro unix/linux 09intro unix/linux 09
intro unix/linux 09duquoi
 
intro unix/linux 10
intro unix/linux 10intro unix/linux 10
intro unix/linux 10duquoi
 
Internal commands.29to30
Internal commands.29to30Internal commands.29to30
Internal commands.29to30myrajendra
 
Unix commands in etl testing
Unix commands in etl testingUnix commands in etl testing
Unix commands in etl testingGaruda Trainings
 
PC Software - Computer Application - Office Automation Tools
PC Software  -  Computer Application - Office Automation ToolsPC Software  -  Computer Application - Office Automation Tools
PC Software - Computer Application - Office Automation Toolszatax
 
Ms dos full explanation
Ms dos full explanation Ms dos full explanation
Ms dos full explanation ParmvirSingh11
 
intro unix/linux 04
intro unix/linux 04intro unix/linux 04
intro unix/linux 04duquoi
 
Bozorgmeh os lab
Bozorgmeh os labBozorgmeh os lab
Bozorgmeh os labFS Karimi
 
intro unix/linux 05
intro unix/linux 05intro unix/linux 05
intro unix/linux 05duquoi
 
intro unix/linux 03
intro unix/linux 03intro unix/linux 03
intro unix/linux 03duquoi
 
Course 102: Lecture 2: Unwrapping Linux
Course 102: Lecture 2: Unwrapping Linux Course 102: Lecture 2: Unwrapping Linux
Course 102: Lecture 2: Unwrapping Linux Ahmed El-Arabawy
 
101 3.4 use streams, pipes and redirects
101 3.4 use streams, pipes and redirects101 3.4 use streams, pipes and redirects
101 3.4 use streams, pipes and redirectsAcácio Oliveira
 
101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystems101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystemsAcácio Oliveira
 
Introduction to LINUX
Introduction to LINUXIntroduction to LINUX
Introduction to LINUXAVI DHALL
 
DOS - Disk Operating System
DOS - Disk Operating SystemDOS - Disk Operating System
DOS - Disk Operating SystemMeqdad Darweesh
 

Tendances (20)

intro unix/linux 09
intro unix/linux 09intro unix/linux 09
intro unix/linux 09
 
Operating system lab manual
Operating system lab manualOperating system lab manual
Operating system lab manual
 
intro unix/linux 10
intro unix/linux 10intro unix/linux 10
intro unix/linux 10
 
basic-unix.pdf
basic-unix.pdfbasic-unix.pdf
basic-unix.pdf
 
Internal commands.29to30
Internal commands.29to30Internal commands.29to30
Internal commands.29to30
 
Unix commands in etl testing
Unix commands in etl testingUnix commands in etl testing
Unix commands in etl testing
 
Os lab manual
Os lab manualOs lab manual
Os lab manual
 
PC Software - Computer Application - Office Automation Tools
PC Software  -  Computer Application - Office Automation ToolsPC Software  -  Computer Application - Office Automation Tools
PC Software - Computer Application - Office Automation Tools
 
Basic Unix
Basic UnixBasic Unix
Basic Unix
 
Ms dos full explanation
Ms dos full explanation Ms dos full explanation
Ms dos full explanation
 
intro unix/linux 04
intro unix/linux 04intro unix/linux 04
intro unix/linux 04
 
Bozorgmeh os lab
Bozorgmeh os labBozorgmeh os lab
Bozorgmeh os lab
 
intro unix/linux 05
intro unix/linux 05intro unix/linux 05
intro unix/linux 05
 
intro unix/linux 03
intro unix/linux 03intro unix/linux 03
intro unix/linux 03
 
Course 102: Lecture 2: Unwrapping Linux
Course 102: Lecture 2: Unwrapping Linux Course 102: Lecture 2: Unwrapping Linux
Course 102: Lecture 2: Unwrapping Linux
 
101 3.4 use streams, pipes and redirects
101 3.4 use streams, pipes and redirects101 3.4 use streams, pipes and redirects
101 3.4 use streams, pipes and redirects
 
101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystems101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystems
 
Introduction to LINUX
Introduction to LINUXIntroduction to LINUX
Introduction to LINUX
 
DOS - Disk Operating System
DOS - Disk Operating SystemDOS - Disk Operating System
DOS - Disk Operating System
 
Comp practical
Comp practicalComp practical
Comp practical
 

En vedette

How to hack windows 8 or 8.1 password using command prompt
How to hack windows 8 or 8.1 password using command promptHow to hack windows 8 or 8.1 password using command prompt
How to hack windows 8 or 8.1 password using command promptMicrosoft
 
How to create windows 10 bootable usb drive from iso using Command Prompt
How to create windows 10 bootable usb drive from iso using Command PromptHow to create windows 10 bootable usb drive from iso using Command Prompt
How to create windows 10 bootable usb drive from iso using Command PromptViney Dhiman
 
Introduction to Powershell Version 5
Introduction to Powershell Version 5Introduction to Powershell Version 5
Introduction to Powershell Version 5Nishtha Kesarwani
 
Execute sql query or sql command sql server using command prompt
Execute sql query or sql command sql server using command promptExecute sql query or sql command sql server using command prompt
Execute sql query or sql command sql server using command promptIkhwan Krisnadi
 
Carlos Díaz y Fco. Jesús Gómez - CMD: Look who's talking too [RootedCON 2012]
Carlos Díaz y Fco. Jesús Gómez - CMD: Look who's talking too [RootedCON 2012]Carlos Díaz y Fco. Jesús Gómez - CMD: Look who's talking too [RootedCON 2012]
Carlos Díaz y Fco. Jesús Gómez - CMD: Look who's talking too [RootedCON 2012]RootedCON
 
Use Powershell to make your life easy.
Use Powershell to make your life easy.Use Powershell to make your life easy.
Use Powershell to make your life easy.Aman Dhally
 
Practical PowerShell Programming for Professional People
Practical PowerShell Programming for Professional PeoplePractical PowerShell Programming for Professional People
Practical PowerShell Programming for Professional PeopleBen Ten (0xA)
 
Computer shortcut keys
Computer shortcut keysComputer shortcut keys
Computer shortcut keysmuhammad ali
 
100+ run commands for windows
100+ run commands for windows 100+ run commands for windows
100+ run commands for windows Anand Garg
 
Stacks Implementation and Examples
Stacks Implementation and ExamplesStacks Implementation and Examples
Stacks Implementation and Examplesgreatqadirgee4u
 
Stack Data Structure & It's Application
Stack Data Structure & It's Application Stack Data Structure & It's Application
Stack Data Structure & It's Application Tech_MX
 
Applications of stack
Applications of stackApplications of stack
Applications of stackeShikshak
 
Pictures For Writing Prompts
Pictures For Writing PromptsPictures For Writing Prompts
Pictures For Writing Promptsbeckerl1
 
Creative visual writing prompts for studuents
Creative visual writing prompts for studuentsCreative visual writing prompts for studuents
Creative visual writing prompts for studuentsLisa Logan
 

En vedette (20)

How to hack windows 8 or 8.1 password using command prompt
How to hack windows 8 or 8.1 password using command promptHow to hack windows 8 or 8.1 password using command prompt
How to hack windows 8 or 8.1 password using command prompt
 
How to create windows 10 bootable usb drive from iso using Command Prompt
How to create windows 10 bootable usb drive from iso using Command PromptHow to create windows 10 bootable usb drive from iso using Command Prompt
How to create windows 10 bootable usb drive from iso using Command Prompt
 
Introduction to Powershell Version 5
Introduction to Powershell Version 5Introduction to Powershell Version 5
Introduction to Powershell Version 5
 
Execute sql query or sql command sql server using command prompt
Execute sql query or sql command sql server using command promptExecute sql query or sql command sql server using command prompt
Execute sql query or sql command sql server using command prompt
 
CMD Command
CMD CommandCMD Command
CMD Command
 
Carlos Díaz y Fco. Jesús Gómez - CMD: Look who's talking too [RootedCON 2012]
Carlos Díaz y Fco. Jesús Gómez - CMD: Look who's talking too [RootedCON 2012]Carlos Díaz y Fco. Jesús Gómez - CMD: Look who's talking too [RootedCON 2012]
Carlos Díaz y Fco. Jesús Gómez - CMD: Look who's talking too [RootedCON 2012]
 
Use Powershell to make your life easy.
Use Powershell to make your life easy.Use Powershell to make your life easy.
Use Powershell to make your life easy.
 
Practical PowerShell Programming for Professional People
Practical PowerShell Programming for Professional PeoplePractical PowerShell Programming for Professional People
Practical PowerShell Programming for Professional People
 
Dos command for hackers
Dos command for hackersDos command for hackers
Dos command for hackers
 
Computer shortcut keys
Computer shortcut keysComputer shortcut keys
Computer shortcut keys
 
Powershell training material
Powershell training materialPowershell training material
Powershell training material
 
100+ run commands for windows
100+ run commands for windows 100+ run commands for windows
100+ run commands for windows
 
Stacks Implementation and Examples
Stacks Implementation and ExamplesStacks Implementation and Examples
Stacks Implementation and Examples
 
Stack Data Structure & It's Application
Stack Data Structure & It's Application Stack Data Structure & It's Application
Stack Data Structure & It's Application
 
Stack Applications
Stack ApplicationsStack Applications
Stack Applications
 
Bios
BiosBios
Bios
 
Applications of stack
Applications of stackApplications of stack
Applications of stack
 
Stack
StackStack
Stack
 
Pictures For Writing Prompts
Pictures For Writing PromptsPictures For Writing Prompts
Pictures For Writing Prompts
 
Creative visual writing prompts for studuents
Creative visual writing prompts for studuentsCreative visual writing prompts for studuents
Creative visual writing prompts for studuents
 

Similaire à Tool Development 08 - Windows Command Prompt

Similaire à Tool Development 08 - Windows Command Prompt (20)

Introduction to ms dos
Introduction to ms dosIntroduction to ms dos
Introduction to ms dos
 
CMake Tutorial
CMake TutorialCMake Tutorial
CMake Tutorial
 
Linux file commands and shell scripts
Linux file commands and shell scriptsLinux file commands and shell scripts
Linux file commands and shell scripts
 
Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...
Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...
Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...
 
Internal commands.29to30
Internal commands.29to30Internal commands.29to30
Internal commands.29to30
 
20 C programs
20 C programs20 C programs
20 C programs
 
Linux com
Linux comLinux com
Linux com
 
Linux
LinuxLinux
Linux
 
Linux
LinuxLinux
Linux
 
Linux
LinuxLinux
Linux
 
Linux
LinuxLinux
Linux
 
Prabu linux
Prabu linuxPrabu linux
Prabu linux
 
Prabu linux
Prabu linuxPrabu linux
Prabu linux
 
Using Unix
Using UnixUsing Unix
Using Unix
 
Group13
Group13Group13
Group13
 
Nithi
NithiNithi
Nithi
 
Unix cmd
Unix cmdUnix cmd
Unix cmd
 
Linux
LinuxLinux
Linux
 
Linux administration training
Linux administration trainingLinux administration training
Linux administration training
 
Raj linux
Raj linux Raj linux
Raj linux
 

Plus de Nick Pruehs

Unreal Engine Basics 06 - Animation, Audio, Visual Effects
Unreal Engine Basics 06 - Animation, Audio, Visual EffectsUnreal Engine Basics 06 - Animation, Audio, Visual Effects
Unreal Engine Basics 06 - Animation, Audio, Visual EffectsNick Pruehs
 
Unreal Engine Basics 05 - User Interface
Unreal Engine Basics 05 - User InterfaceUnreal Engine Basics 05 - User Interface
Unreal Engine Basics 05 - User InterfaceNick Pruehs
 
Unreal Engine Basics 04 - Behavior Trees
Unreal Engine Basics 04 - Behavior TreesUnreal Engine Basics 04 - Behavior Trees
Unreal Engine Basics 04 - Behavior TreesNick Pruehs
 
Unreal Engine Basics 03 - Gameplay
Unreal Engine Basics 03 - GameplayUnreal Engine Basics 03 - Gameplay
Unreal Engine Basics 03 - GameplayNick Pruehs
 
Unreal Engine Basics 02 - Unreal Editor
Unreal Engine Basics 02 - Unreal EditorUnreal Engine Basics 02 - Unreal Editor
Unreal Engine Basics 02 - Unreal EditorNick Pruehs
 
Unreal Engine Basics 01 - Game Framework
Unreal Engine Basics 01 - Game FrameworkUnreal Engine Basics 01 - Game Framework
Unreal Engine Basics 01 - Game FrameworkNick Pruehs
 
Game Programming - Cloud Development
Game Programming - Cloud DevelopmentGame Programming - Cloud Development
Game Programming - Cloud DevelopmentNick Pruehs
 
Game Programming - Git
Game Programming - GitGame Programming - Git
Game Programming - GitNick Pruehs
 
Eight Rules for Making Your First Great Game
Eight Rules for Making Your First Great GameEight Rules for Making Your First Great Game
Eight Rules for Making Your First Great GameNick Pruehs
 
Designing an actor model game architecture with Pony
Designing an actor model game architecture with PonyDesigning an actor model game architecture with Pony
Designing an actor model game architecture with PonyNick Pruehs
 
Game Programming 13 - Debugging & Performance Optimization
Game Programming 13 - Debugging & Performance OptimizationGame Programming 13 - Debugging & Performance Optimization
Game Programming 13 - Debugging & Performance OptimizationNick Pruehs
 
Scrum - but... Agile Game Development in Small Teams
Scrum - but... Agile Game Development in Small TeamsScrum - but... Agile Game Development in Small Teams
Scrum - but... Agile Game Development in Small TeamsNick Pruehs
 
Component-Based Entity Systems (Demo)
Component-Based Entity Systems (Demo)Component-Based Entity Systems (Demo)
Component-Based Entity Systems (Demo)Nick Pruehs
 
What Would Blizzard Do
What Would Blizzard DoWhat Would Blizzard Do
What Would Blizzard DoNick Pruehs
 
School For Games 2015 - Unity Engine Basics
School For Games 2015 - Unity Engine BasicsSchool For Games 2015 - Unity Engine Basics
School For Games 2015 - Unity Engine BasicsNick Pruehs
 
Tool Development A - Git
Tool Development A - GitTool Development A - Git
Tool Development A - GitNick Pruehs
 
Game Programming 12 - Shaders
Game Programming 12 - ShadersGame Programming 12 - Shaders
Game Programming 12 - ShadersNick Pruehs
 
Game Programming 11 - Game Physics
Game Programming 11 - Game PhysicsGame Programming 11 - Game Physics
Game Programming 11 - Game PhysicsNick Pruehs
 
Game Programming 10 - Localization
Game Programming 10 - LocalizationGame Programming 10 - Localization
Game Programming 10 - LocalizationNick Pruehs
 
Game Programming 09 - AI
Game Programming 09 - AIGame Programming 09 - AI
Game Programming 09 - AINick Pruehs
 

Plus de Nick Pruehs (20)

Unreal Engine Basics 06 - Animation, Audio, Visual Effects
Unreal Engine Basics 06 - Animation, Audio, Visual EffectsUnreal Engine Basics 06 - Animation, Audio, Visual Effects
Unreal Engine Basics 06 - Animation, Audio, Visual Effects
 
Unreal Engine Basics 05 - User Interface
Unreal Engine Basics 05 - User InterfaceUnreal Engine Basics 05 - User Interface
Unreal Engine Basics 05 - User Interface
 
Unreal Engine Basics 04 - Behavior Trees
Unreal Engine Basics 04 - Behavior TreesUnreal Engine Basics 04 - Behavior Trees
Unreal Engine Basics 04 - Behavior Trees
 
Unreal Engine Basics 03 - Gameplay
Unreal Engine Basics 03 - GameplayUnreal Engine Basics 03 - Gameplay
Unreal Engine Basics 03 - Gameplay
 
Unreal Engine Basics 02 - Unreal Editor
Unreal Engine Basics 02 - Unreal EditorUnreal Engine Basics 02 - Unreal Editor
Unreal Engine Basics 02 - Unreal Editor
 
Unreal Engine Basics 01 - Game Framework
Unreal Engine Basics 01 - Game FrameworkUnreal Engine Basics 01 - Game Framework
Unreal Engine Basics 01 - Game Framework
 
Game Programming - Cloud Development
Game Programming - Cloud DevelopmentGame Programming - Cloud Development
Game Programming - Cloud Development
 
Game Programming - Git
Game Programming - GitGame Programming - Git
Game Programming - Git
 
Eight Rules for Making Your First Great Game
Eight Rules for Making Your First Great GameEight Rules for Making Your First Great Game
Eight Rules for Making Your First Great Game
 
Designing an actor model game architecture with Pony
Designing an actor model game architecture with PonyDesigning an actor model game architecture with Pony
Designing an actor model game architecture with Pony
 
Game Programming 13 - Debugging & Performance Optimization
Game Programming 13 - Debugging & Performance OptimizationGame Programming 13 - Debugging & Performance Optimization
Game Programming 13 - Debugging & Performance Optimization
 
Scrum - but... Agile Game Development in Small Teams
Scrum - but... Agile Game Development in Small TeamsScrum - but... Agile Game Development in Small Teams
Scrum - but... Agile Game Development in Small Teams
 
Component-Based Entity Systems (Demo)
Component-Based Entity Systems (Demo)Component-Based Entity Systems (Demo)
Component-Based Entity Systems (Demo)
 
What Would Blizzard Do
What Would Blizzard DoWhat Would Blizzard Do
What Would Blizzard Do
 
School For Games 2015 - Unity Engine Basics
School For Games 2015 - Unity Engine BasicsSchool For Games 2015 - Unity Engine Basics
School For Games 2015 - Unity Engine Basics
 
Tool Development A - Git
Tool Development A - GitTool Development A - Git
Tool Development A - Git
 
Game Programming 12 - Shaders
Game Programming 12 - ShadersGame Programming 12 - Shaders
Game Programming 12 - Shaders
 
Game Programming 11 - Game Physics
Game Programming 11 - Game PhysicsGame Programming 11 - Game Physics
Game Programming 11 - Game Physics
 
Game Programming 10 - Localization
Game Programming 10 - LocalizationGame Programming 10 - Localization
Game Programming 10 - Localization
 
Game Programming 09 - AI
Game Programming 09 - AIGame Programming 09 - AI
Game Programming 09 - AI
 

Dernier

ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDELiveplex
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintMahmoud Rabie
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioChristian Posta
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Commit University
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-pyJamie (Taka) Wang
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxGDSC PJATK
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesMd Hossain Ali
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024D Cloud Solutions
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsSafe Software
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding TeamAdam Moalla
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxMatsuo Lab
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfDaniel Santiago Silva Capera
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfAijun Zhang
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Adtran
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopBachir Benyammi
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfJamie (Taka) Wang
 

Dernier (20)

ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership Blueprint
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
20230104 - machine vision
20230104 - machine vision20230104 - machine vision
20230104 - machine vision
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and Istio
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-py
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptx
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptx
 
201610817 - edge part1
201610817 - edge part1201610817 - edge part1
201610817 - edge part1
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdf
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 Workshop
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
 

Tool Development 08 - Windows Command Prompt

  • 1. Tool Development Chapter 08: Windows Command Prompt Nick Prühs
  • 3. Objectives • To understand how to interact with the Windows command prompt • To learn how to create tool chains by creating new processes in .NET 3 / 58
  • 4. Windows Commands 4 / 58 Command Description Attrib Displays, sets, or removes attributes assigned to files or directories. Cd Displays the name of or changes the current directory. Cls Clears the Command Prompt window. Copy Copies one or more files from one location to another. Del Deletes one or more files. Dir Displays a list of a directory's files and subdirectories. Echo Displays messages or turns on or off the command echoing feature. Md Creates a directory or subdirectory. Move Moves one or more files from one directory to another directory. Rd Deletes a directory. Xcopy Copies files and directories, including subdirectories.
  • 5. Attrib Command Displays, sets, or removes attributes assigned to files or directories. Syntax: attrib [{+|-}r] [{+|-}h] [<Drive>:][<Path>][<FileName>] [/s [/d]] 5 / 58
  • 6. Cd Command Displays the name of or changes the current directory. Syntax: cd [<Drive>:][<Path>] cd [..] 6 / 58
  • 7. Cls Command Clears the Command Prompt window. Syntax: cls 7 / 58
  • 8. Copy Command Copies one or more files from one location to another. Syntax: copy [/y] <Source> [+<Source> [+ ...]] [<Destination>] 8 / 58
  • 9. Del Command Deletes one or more files. Syntax: del [/s] <Names> 9 / 58
  • 10. Dir Command Displays a list of a directory's files and subdirectories. Syntax: dir [<Drive>:][<Path>][<FileName>] [/p] [/a[[:]<Attributes>]] [/s] 10 / 58
  • 11. Echo Command Displays messages or turns on or off the command echoing feature. Syntax: echo [<Message>] echo [on | off] 11 / 58
  • 12. Md Command Creates a directory or subdirectory. Syntax: md [<Drive>:]<Path> 12 / 58
  • 13. Move Command Moves one or more files from one directory to another directory. Syntax: move [<Source>] [<Target>] 13 / 58
  • 14. Rd Command Deletes a directory. Syntax: rd [<Drive>:]<Path> [/s] 14 / 58
  • 15. Xcopy Command Copies files and directories, including subdirectories. Syntax: Xcopy <Source> <Destination> [/q] [/s] [/h] 15 / 58
  • 16. Command Prompt Wildcards Used to represent one or more characters when you are searching for files, folders, printers, computers, or people. 16 / 58 Wildcard character Description Asterisk (*) Substitute for zero or more characters. Question mark (?) Substitute for a single character in a name.
  • 17. Windows Batch Files • Unformatted text file that contains one or more commands and has a .bat file name extension. • Allows you to simplify routine or repetitive tasks. • When you type the file name at the command prompt, Cmd.exe runs the commands sequentially as they appear in the file. 17 / 58
  • 18. Batch File Parameters • Cmd.exe provides the batch parameter expansion variables %0 through %9. • %0 is replaced by the batch file name. • %1 through %9 are replaced by the corresponding arguments that you type at the command line. 18 / 58
  • 19. Command Redirection Operators 19 / 58 Redirection operator Description > Writes the command output to a file or a device, such as a printer, instead of the Command Prompt window. < Reads the command input from a file, instead of reading input from the keyboard. >> Appends the command output to the end of a file without deleting the information that is already in the file. | Reads the output from one command and writes it to the input of another command. Also known as a pipe.
  • 20. Batch File Commands 20 / 58 Command Description If Performs conditional processing in batch programs. Goto Within a batch program, redirects to a line identified by a label. Rem Enables you to include comments (remarks) in a batch file or in your configuration files.
  • 21. If Command Performs conditional processing in batch programs. Syntax: if [not] errorlevel number command [else expression] if [not] string1==string2 command [else expression] if [not] exist FileName command [else expression] 21 / 58
  • 22. Goto Command Within a batch program, redirects to a line identified by a label. Syntax: goto label :label 22 / 58
  • 23. Rem Command Enables you to include comments (remarks) in a batch file or in your configuration files. Syntax: rem [comment] 23 / 58
  • 24. Command-Line Paramters in .NET Application Type Parameter Access Console Application static void Main(string[] args) WPF Application StartupEventArgs of the Startup event handler General Environment.GetCommandLineArg s(); 24 / 58
  • 25. Command-Line Paramters in .NET C# 25 / 58 public static void Main(string[] args) { // Print all parameters to the console. foreach (var arg in args) { Console.WriteLine(arg); } }
  • 26. Starting Programs in .NET • Process class is a useful tool for starting, stopping, controlling, and monitoring applications • You can obtain a list of the processes that are running, or you can start a new process • After a Process has been initialized, it can be used to obtain information about the running process • set of threads • loaded modules (.dll and .exe files) • amount of memory the process is using 26 / 58
  • 27. Starting Programs in .NET • The operating system persists the process handle, which is accessed through the Handle property of the Process component, even when the process has exited. • Thus, you can get the process's administrative information, such as the ExitCode and the ExitTime. 27 / 58
  • 28. Starting Programs in .NET C# 28 / 58 // Create new process object. Process process = new Process(); // Set target file and command-line arguments. process.StartInfo.FileName = "ParameterDemo.exe"; process.StartInfo.Arguments = "/s"; // Start process. process.Start();
  • 29. Starting Programs in .NET C# 29 / 58 // Create new process object. Process process = new Process(); // Set target file. Windows will automatically open the file with the default program. process.StartInfo.FileName = "textfile.txt"; // Start process. process.Start();
  • 30. Assignment #8 1. Title Bar – Map File Name 1. Keep the file stream of the current map file open until a new map is created or opened. 2. Update the title of the main window, always showing the name of the current map file. 30 / 58
  • 31. Assignment #8 2. Save to Current File 1. Add a Save menu item to the File menu of the Main Window, and change the Save As toolbar button to a Save toolbar button. 2. Executing the Save command should write the current map data to the current map file, if any, and open the Save As dialog otherwise. 31 / 58
  • 32. Assignment #8 3. Title Bar – Modified Asterisk Update the title of the main window, showing an asterisk after the current map file name while the map is dirty. 32 / 58
  • 33. References • Microsoft. Command-Line Reference. http://technet.microsoft.com/en- us/library/cc754340.aspx, November 23, 2015. • Microsoft. Using batch files. https://www.microsoft.com/resources/documentat ion/windows/xp/all/proddocs/en- us/batch.mspx?mfr=true, May 2016. • Microsoft. Using wildcard characters. http://technet.microsoft.com/en- us/library/bb490639.aspx, May 2016. 33 / 58
  • 35. 5 Minute Review Session • Which wildcards are available at the windows command prompt? • How do you access parameters in batch files? • Which redirection operator writes the command output to a file or a device instead of the Command Prompt window? • How do you access command-line parameters in .NET? • How do start other programs from your .NET application? 35 / 58