FREE PLUGIN: Advanced Shell

Command Line WindowAdvanced Shell plugin will add 5 new UBot commands/functions to your UBot environment, and will allow you to hide that annoying Shell/Command Prompt window (“cmd.exe” will run in background), run Batch File Commands directly from UBot (no external batch files needed) and even retrieve the output from Command Prompt with UBot function (instead of reading additional files).

COMMANDS AND FUNCTIONS

After plugin installation all commands can be found under “File Commands” and both function will be under “File Function”. New commands/functions work exactly the same as current “shell” command (in terms of execution), they just add new functionality (batch,hidden).

COMMAND: Shell/Command Prompt Hidden

Shell Hidden Command

Command “shell hidden” is the one that is the most similar to original “Shell” command, with the difference that this one runs hidden – no window popup.

FUNCTION: Shell/Command Prompt Hidden

Shell Hidden FunctionFunction “shell hidden” executes a batch file hidden, and it returns the output from Command Prompt, which can be later used by UBot.

 

 

 

 

COMMAND: Shell/Command Prompt Batch

Shell Batch CommandCommand “shell batch” executes batch file commands that you provide as input right inside UBot, instead of executing an external batch file. The command will open a new visible window and won’t run hidden, allowing you do debug batch commands. This command will execute shell (cmd.exe) that supports input, so user can interact with Command Prompt Window.

COMMAND: Shell/Command Prompt Batch Hidden

Shell Batch Hidden Command

Command “shell batch hidden” is very similar to “Shell Batch” command, so it also accepts batch file commands as input, but this time the shell run hidden, so no window is displayed.

FUNCTION: Shell/Command Prompt Batch Hidden

Shell Batch Hidden FunctionFunction “shell batch hidden” will also accept batch file commands as input  and run hidden as command with the same name does, but will in addition return the output from Command Prompt, which can be later used by UBot.

 

 

 

COMMAND: Delete Permanently (additional command)

Although not planned to release with this plugin (I was thinking to include that as a part of another plugin, but forgot to remove it), you’ll also find a command called “delete permanently”, which will delete the file from computer instead of moving it to the Recycle Bin as current command does.

ATTENTION: Use this command carefully to prevent deletion of important files. We don’t take any responsibilities for usage of this command.

 

NOTES

Command Prompt Input Handling

When you are using command that has word “hidden” in its name or using a function, execution of that batch file/commands is hidden and there so user input for that window is disabled (user can’t interact with it), which means that commands like “pause” won’t work (because they require user input).

Debugging Hidden Commands And Functions

Sometimes you’ll want to know whats happening in Command Line window when its running hidden, so you can assure it’s working exactly as you want. Since Command Prompt window is hidden, you won’t be able to see Command Prompt window or anything that gets displayed inside of it.

Using functions is the most straight forward way, since it will return the output directly to UBot, so you can store that information.

If you don’t want to bring this information into UBot, you can also use commands that don’t run hidden.

Debugging Shell Hidden Command

For debugging “Shell Hidden” command you should use original “shell” command:

Debugging Shell Batch Hidden Command

If you are using command Shell Batch Hidden, you can use Command “Shell Batch”  for debugging:

 

Using CMD Switches

Using switches is not allowed, since the commands/functions internally use /C switch, which allows us to execute multiple Command Prompt commands defined with a single string delimited by new line (the string is internally parsed so it forms a valid Command Prompt command).

 

UBOT CODE EXAMPLES

Run A Batch File

Executes commands from batch file (usually .bat extension).

Clear Cookies

I usually clear cookies with CCleaner and special Windows command which clears FLASH cookies.  We need to do that via “shell” command; in order to hide the Command Prompt window we can now use “shell hidden” command:

The code above will execute 64 bit version of CCleaner, so if you use 32bit version, make sure to change the CCleaner executable path.

 

Open URL In Default Browser

In order to open an URL in the default browser, we were using “shell” command, but now we can use “shell hidden” and hide the Command Prompt window that would get displayed before page starts loading.

 

Read File Name and Size For Files In Folder

This example demonstrates how to use shell functions to read the output of Command Prompt. Specifically we will read the output and extract a file name and a file size with regular expression, and save all into a table.

 

ADDITIONAL READING

 

UPDATE v1.01

“Wait For Exit” Option For Commands

On request I’ve added an option to all plugin commands, which allows you to decide if you want to wait for the command to end with it’s execution (for application to exit) or not. In a few words this means that you can now launch a program without waiting for it to exit (UBot proceeds with executing the next command right after shell command(s) is/are executed).

 

UBOT FORUM DISCUSSION

[FREE PLUGIN] Advanced Shell

 

DOWNLOAD

DOWNLOAD FREE PLUGINS

If you like this FREE UBot Plugin or find the post useful, please consider leaving a comment bellow or sharing it on your favorite social network.

One thought on “FREE PLUGIN: Advanced Shell

Leave a Reply

Your email address will not be published. Required fields are marked *

*