Jump to content
Sign in to follow this  
ray

Bat file to Automate Script

Recommended Posts

I'm new to automate scripting. I have a bat file I received from one of our vendors to uninstall some software. Is there an existing automate  script example that I can go by that will help me understand how to convert a bat file to a script? If not, is there an example of running a bat file using a script?
 

this is the bat file...

@echo off
IF "%PROCESSOR_ARCHITECTURE%" == "x86" GOTO UNINSTALL_X86
taskkill /F /IM snapw.exe
taskkill /F /IM SnapAgent.exe
wmic product where "description='SnapAgent'" uninstall
taskkill /F /IM snapw.exe
taskkill /F /IM SnapAgent.exe
IF EXIST "%ProgramFiles(x86)%\Blackpoint" rmdir /S /Q "%ProgramFiles(x86)%\Blackpoint"
IF EXIST "%ProgramFiles(x86)%\Blackpoint" rmdir /S /Q "%ProgramFiles(x86)%\Blackpoint"
exit /b 0

:UNINSTALL_X86
taskkill /F /IM snapw.exe
taskkill /F /IM SnapAgent.exe
wmic product where "description='SnapAgent'" uninstall
taskkill /F /IM snapw.exe
taskkill /F /IM SnapAgent.exe
IF EXIST "%ProgramFiles%\Blackpoint" rmdir /S /Q "%ProgramFiles%\Blackpoint"
IF EXIST "%ProgramFiles%\Blackpoint" rmdir /S /Q "%ProgramFiles%\Blackpoint"
exit /b 0

Share this post


Link to post
Share on other sites

You can convert to an Automate script (Shell Execute for the taskkill and wmic commands, Folder Delete command for deleting the folders, just create entries that are filtered by 32-bit and 64-bit), but the simpler method is to just use the Execute Script function and set it to BAT file, paste that in, and you're done.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...