Ex08-Windows-basic-commands-batchscript
To execute Windows basic commands and batch scripting
Navigate to any Windows environment installed on the system or installed inside a virtual environment like virtual box/vmware
Write the Windows commands / batch file Save each script in a file with a .bat extension. Ensure you have the necessary permissions to perform the operations. Adapt paths as needed based on your system configuration.
Execute the necessary commands/batch file for the desired output.
Create a directory named "MyLab" on the desktop.
Change to the "MyLab" directory and create an empty text file named "MyFile.txt" inside it. mkdir %userprofile%\Desktop\MyLab
List the contents of the "MyLab" directory.
cd %userprofile%\Desktop\MyLab
Copy "MyFile.txt" to a new folder named "Backup" on the desktop.
dir %userprofile%\Desktop\MyLab
Move the "MyLab" directory to the "Documents" folder. mkdir %userprofile%\Desktop\Backup mkdir %userprofile%\Desktop\Backup
mv Myfile.txt %userprofile%\Documents
Create a batch script named "BackupScript.bat" that creates a backup of files with the ".docx" extension from the "Documents" folder to a new folder named "DocBackup" on the desktop.
@echo off mkdir %userprofile%\Desktop\DocBackup copy %userprofile%\Documents*.docx %userprofile%\Desktop\DocBackup echo Backup completed successfully!