How to perform simple operations using Subject7

If you have simple operations that you manually do with files on Windows operating system, you can use  commands that are ordinarily used on PowerShell or Command Prompt through Subject7 using Execute_Command.

 

1. Get the username of the test machine and store it in a variable using Command Prompt

Windows:
cmd.exe

/c
echo %username%

macOS/Linux:
whoami

mceclip7.png

 

2. Extract a content of a Zip file into a folder using PowerShell

powershell.exe
Expand-Archive -LiteralPath C:\Users\USERNAME\Downloads\FILE.ZIP -DestinationPath C:\Users\USERNAME\Downloads\FOLDER

mceclip8.png

 

3. Get the name of a file in a specific path with an extension and store it in a variable using PowerShell

powershell.exe
get-childitem -path C:\Users\USERNAME\Downloads\FOLDER-name

mceclip9.png

 

4. Get the name of a specific file in a specific path without an extension and store it in a variable using PowerShell

powershell.exe
[System.IO.Path]::GetFileNameWithoutExtension('C:\Users\USERNAME\Downloads\Export\Filename.pdf')

mceclip10.png

 

5. Change the name and/or extension of a file to another name/extension using PowerShell

powershell.exe
Rename-Item -Path "C:\Users\USERNAME\Downloads\Export\FILE_NAME.XML" -NewName "FILE_NAME.csv"

mceclip11.png

 

6. Remove an empty directory using Command Prompt

cmd.exe
/c
rmdir C:\Users\USERNAME\Downloads\FOLDER

mceclip0.png

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Please sign in to leave a comment.