Completely Automated Script

You need help to start using UVK? You have a doubt on a UVK feature? Post here!
Forum rules
We have no special rules for UVK forums. Just try to be polite and clear in your posts.
Please don't post spam in this forum. Spammers will be banned by IP, e-mail and username.
We reserve the right to delete all posts and ban all users we consider not having respected these rules without warning.
ShaunPrincePC
Posts: 12
Joined: Tue Aug 04, 2015 10:45 am

Completely Automated Script

Post by ShaunPrincePC »

Hi all,

What I would really like to do is be able to install UVK on a computer and have it weekly run the maintenance and repair script without being noticed by the computer user. An email saying it had been completed would be nice. I have played with the automation but can't quite figure it out.

Ideally I would install my Premium copy on a computer, set a script up and leave it to run until I removed it at a later date. Like I say, possibly running on a weekly basis. I see there is an auto schedule in the System Booster but I want to offer something a bit more indepth that this on a regualr basis without having to manually run the script.

I have tried creating a script and running through the Windows Task Scheduler but it wont automatically run UVK.

Any ideas are much appreciated.

Shaun
Charger440
Posts: 1529
Joined: Sun May 25, 2014 7:44 am
Location: Missouri

Re: Completely Automated Script

Post by Charger440 »

I'd be interested in seeing this. I'm not aware of a way to hide the UVK GUI. I would also think you would want to password the instance of UVK because leaving the paid version on a computer can allow the user to mess up the system. Although the free one could as well, I think the tools built into UVK that can are limited to the paid version. Could be wrong on that though.
Jim

It is not "Can it be done?" but rather, "How can we do it?"
ShaunPrincePC
Posts: 12
Joined: Tue Aug 04, 2015 10:45 am

Re: Completely Automated Script

Post by ShaunPrincePC »

I have managed to get the Repair / Maintenance script running via a weekly trigger in the Windows Task Scheduler. However in the Log Analyzer I am struggling to input my password to open UVK in the popup box when the event is triggered. I can get it running without password protection but as Jim says I don't fancy leaving my paid software open for anyone on the computer to use.

So I am effectively looking for a script to wait for the UVK password box, insert the required password and continue the script. If I could get that I am pretty sure I've got this cracked.

Any help is much appreciated. I have tried playing around with the Automation with things like waiting for a window and text inputting but I really am stumped.
Fred
Site Admin
Posts: 2360
Joined: Sat Jul 30, 2011 12:05 pm
Location: Red coast, France
Contact:

Re: Completely Automated Script

Post by Fred »

You guys don't need any automation. Just create a schedule task that runs once weekly and runs a command such as:

Code: Select all

"%ProgramFiles%\UVK - Ultra Virus Killer\UVK_en.exe" /ReadFile "Full path of the script" /Auto
You can even make a script that creates the scheduled task:

Code: Select all

<RunWait> -h
%SystemDir%\schtasks.exe /create /tn "Weekly maintenance" /tr "'%UVKDir%\UVK_en.exe' /ReadFile 'Full path of the script' /Auto" /ru "%UserName%" /sc WEEKLY /d WED /it
The command above schedules a task that runs the script specified in 'Full path of the script' every Wednesday, when the current user is logged in.
One thing we humans have in common is that we are all different. So, if you think you're weird because you're different from everyone else, then we are all weird.

Fred
ShaunPrincePC
Posts: 12
Joined: Tue Aug 04, 2015 10:45 am

Re: Completely Automated Script

Post by ShaunPrincePC »

Thanks for this. However, when the UVK application is opened by the task it will prompt for the password to run the application. Can this be overcome without the need to remove the password from the software?
Fred
Site Admin
Posts: 2360
Joined: Sat Jul 30, 2011 12:05 pm
Location: Red coast, France
Contact:

Re: Completely Automated Script

Post by Fred »

I'll check out that for you asap.
One thing we humans have in common is that we are all different. So, if you think you're weird because you're different from everyone else, then we are all weird.

Fred
ShaunPrincePC
Posts: 12
Joined: Tue Aug 04, 2015 10:45 am

Re: Completely Automated Script

Post by ShaunPrincePC »

Thanks Fred
Fred
Site Admin
Posts: 2360
Joined: Sat Jul 30, 2011 12:05 pm
Location: Red coast, France
Contact:

Re: Completely Automated Script

Post by Fred »

This is not easy because we need to enter the password before any script is parsed. So, automating from the script itself is useless, because you need to enter the password before UVK starts parsing the script.

The easiest way I managed to achieve this was by using a batch file to temporarily disable the password, run the script, and then enable the password back.

Open UVK, go to the Options section, setup your password, and then press Save to file. Save to the deskop. Rename the saved file (UVKSettings.ini) WithPass.ini.

Go to the Options section again, remove the password, press Save to file again. Save to the deskop. Rename the saved file (UVKSettings.ini) WithoutPass.ini.

Create your maintenance script, save to the desktop, naming the file maintenance.uvk.

Create a batch file in the desktop named RunWOPass.bat with the following commands:

Code: Select all

@echo off
Copy /y "%~dp0WithoutPass.ini" "%ProgramFiles%\UVK - Ultra Virus Killer\UVKSettings.ini"
start /wait "" "%ProgramFiles%\UVK - Ultra Virus Killer\UVK_en.exe" -ReadFile "%~dp0maintenance.uvk" -Auto
Copy /y "%~dp0WithPass.ini" "%ProgramFiles%\UVK - Ultra Virus Killer\UVKSettings.ini"
You can move the four files to some other folder, but they all need to be in the same directory.

Create a scheduled task that starts the batch file using the following command:

Code: Select all

schtasks.exe /create /tn "Weekly maintenance" /tr "Full path of the RunWOPass.bat batch file" /ru "%UserName%" /sc WEEKLY /d WED /it /rl HIGHEST
/rl HIGHEST (Run the task with admin privileges) is very important, don't omit it. I tested the batch, it was working fine. Didn't test the task, though.
One thing we humans have in common is that we are all different. So, if you think you're weird because you're different from everyone else, then we are all weird.

Fred
ShaunPrincePC
Posts: 12
Joined: Tue Aug 04, 2015 10:45 am

Re: Completely Automated Script

Post by ShaunPrincePC »

Thank you so much! I will try this now and let you know how I get on
ShaunPrincePC
Posts: 12
Joined: Tue Aug 04, 2015 10:45 am

Re: Completely Automated Script

Post by ShaunPrincePC »

Done as instructed.

When the bat file is run as administrator, it says the file is copied. But when I direct to the %ProgramFiles%\UVK - Ultra Virus Killer\ folder the UVKSettings.ini file isn't there. It is before the script is run. The password box pops up and I press cancel. Then the batch file continues and the existing password protected file is copied into the %ProgramFiles%\UVK - Ultra Virus Killer\ folder.

Any ideas Fred?
ShaunPrincePC
Posts: 12
Joined: Tue Aug 04, 2015 10:45 am

Re: Completely Automated Script

Post by ShaunPrincePC »

The UVKSettings.ini file seems to vanish every time the UVK_en.exe program is started regardless if started from script or manually
Fred
Site Admin
Posts: 2360
Joined: Sat Jul 30, 2011 12:05 pm
Location: Red coast, France
Contact:

Re: Completely Automated Script

Post by Fred »

Yes, UVK deletes the ini file. That's normal. It worked for me when I tried but now it's behaving as you describe. I'll have to check it out again.
One thing we humans have in common is that we are all different. So, if you think you're weird because you're different from everyone else, then we are all weird.

Fred
Fred
Site Admin
Posts: 2360
Joined: Sat Jul 30, 2011 12:05 pm
Location: Red coast, France
Contact:

Re: Completely Automated Script

Post by Fred »

OK, Shaun, now it seems to be working properly.

Delete WithoutPass.ini. You no longer need it.
Make the code of the batch as follows:

Code: Select all

@echo off
set settingspath=%ProgramFiles%\UVK - Ultra Virus Killer\UVKSettings.ini
if exist "%settingspath%" del /f /q "%settingspath%">nul

set regkey=HKLM\SOFTWARE\Microsoft\DataAccess\RootBinder
reg.exe delete %regkey% /v MBinder /f

start /wait "" "%ProgramFiles%\UVK - Ultra Virus Killer\UVK_en.exe" -ReadFile "%~dp0maintenance.uvk" -Auto
Copy /y "%~dp0WithPass.ini" "%ProgramFiles%\UVK - Ultra Virus Killer\UVKSettings.ini"
Don't forget to run the batch as admin. It should be working now.
One thing we humans have in common is that we are all different. So, if you think you're weird because you're different from everyone else, then we are all weird.

Fred
ShaunPrincePC
Posts: 12
Joined: Tue Aug 04, 2015 10:45 am

Re: Completely Automated Script

Post by ShaunPrincePC »

Trying it now, thanks Fred!
ShaunPrincePC
Posts: 12
Joined: Tue Aug 04, 2015 10:45 am

Re: Completely Automated Script

Post by ShaunPrincePC »

This script is running perfectly thank you to all who helped!

One more request...

I am looking to include a completely automated threat scan of malwarebytes (either free or premium which ever is installed on the machine). Running the <MBAMScan> requires the user to initiate the scan when run through the Log Analyser. How can I automate it from start to finish entirely so that I can include it as part of my completely automated script?

Thanks in advance
Fred
Site Admin
Posts: 2360
Joined: Sat Jul 30, 2011 12:05 pm
Location: Red coast, France
Contact:

Re: Completely Automated Script

Post by Fred »

Shaun, there's this script in the script collection that may help you to get started.
One thing we humans have in common is that we are all different. So, if you think you're weird because you're different from everyone else, then we are all weird.

Fred
ShaunPrincePC
Posts: 12
Joined: Tue Aug 04, 2015 10:45 am

Re: Completely Automated Script

Post by ShaunPrincePC »

Thanks for your reply.

I have tried using the script but when the scan has completed, it sits at the "Scan was Completed" page waiting for the user to click Finish. I have tried automating this button click waiting for the process to stop and clickpos on the button but the script doesn't seem to see the process as finishing until the user has clicked Finish.

Any ideas? Thanks
Fred
Site Admin
Posts: 2360
Joined: Sat Jul 30, 2011 12:05 pm
Location: Red coast, France
Contact:

Re: Completely Automated Script

Post by Fred »

Shaun, automating the new MBAM's GUI is not easy because it no longer uses common Windows controls. It's now created with QT. Since we can not use ->WaitControl() or ->WaitControlState() to determine the correct moment to click the button, I guess the only way out is to make UVK wait long enough to perform the scan in a slow machine, and then click the button.

You have to use ->Sleep(), not <Sleep>, and specify the time to wait in milliseconds. For instance, to wait 30 minutes, you specify ->Sleep(1800000).
One thing we humans have in common is that we are all different. So, if you think you're weird because you're different from everyone else, then we are all weird.

Fred
ShaunPrincePC
Posts: 12
Joined: Tue Aug 04, 2015 10:45 am

Re: Completely Automated Script

Post by ShaunPrincePC »

Thanks for the reply. I had half guessed as much but wanted an answer from someone who knows before I assumed. I will make it wait for something like an hour and tell it to press the finish button.

Thanks again
ShaunPrincePC
Posts: 12
Joined: Tue Aug 04, 2015 10:45 am

Re: Completely Automated Script

Post by ShaunPrincePC »

Just had a thought about our Malwarebytes issue. When you run the scan through UVK System Repair, you have the option to Stop Monitoring this process. Is there any way to simulate this through the Automated Script do you think?
Post Reply