SDelete with Uninst_UVK_AtLogon.uvk

Post tutorials and script examples in this forum.
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.
Post Reply
wrc559
Posts: 118
Joined: Sun Mar 22, 2015 2:38 am
Location: Australia
Contact:

SDelete with Uninst_UVK_AtLogon.uvk

Post by wrc559 »

Hey,

I wanna be able to remove the content of a folder or the whole folder (Full of repair tools) when the PC is restarted. Is it possible to perform this after PC reboot # 2, or only after the first PC reboot?

This was my current attempt... with no luck - which follows on from Fred's UVK command.

<UVKCommandsScript>
<RunWait> -h
%SystemDir%\schtasks.exe /create /tn "Uninstall UVK on startup" /tr "'%UVKDir%\UVK_en.exe' -Uninst -Auto" /ru System /sc ONSTART
%SystemDir%\schtasks.exe /create /tn "Uninstall UVK on startup" /tr "'%UVKDir%\UVK_en.exe' -Uninst -Auto" /ru System /sc ONSTART /rl HIGHEST /delay 0005:00 /f
%SystemDir%\schtasks.exe /create /tn "Delete RepairTool Folder On Startup" /tr "<SDelete> %Desktop%\Repair Tool Software"
wrc559
Posts: 118
Joined: Sun Mar 22, 2015 2:38 am
Location: Australia
Contact:

Re: SDelete with Uninst_UVK_AtLogon.uvk

Post by wrc559 »

Wait, I think I found out, Trying to run a UVK command through the SchTasks.. Anyway, if someone can assist me in my project that would be awesome :)
Charger440
Posts: 1529
Joined: Sun May 25, 2014 7:44 am
Location: Missouri

Re: SDelete with Uninst_UVK_AtLogon.uvk

Post by Charger440 »

I need to go to bed but here is the best hint I can find at the moment.... From MSDN:

/SC schedule

A value that specifies the schedule frequency. Valid values are: MINUTE, HOURLY, DAILY, WEEKLY, MONTHLY, ONCE, ONLOGON, ONIDLE, and ONEVENT.


ONSTART is not listed in the /SC params, it's actually in the /MO params
Jim

It is not "Can it be done?" but rather, "How can we do it?"
Fred
Site Admin
Posts: 2357
Joined: Sat Jul 30, 2011 12:05 pm
Location: Red coast, France
Contact:

Re: SDelete with Uninst_UVK_AtLogon.uvk

Post by Fred »

WRC, <SDelete> is a UVK scripting keyword, and thus is only understood by UVK. Windows does not recognize it.

Replace the last command with this one:

Code: Select all

%SystemDir%\schtasks.exe /create /tn "Delete RepairTool Folder On Startup" /tr "%ComSpec% /c rd /s /q '%Desktop%\Repair Tool Software'"
Don't forget the quotes around %Desktop%\Repair Tool Software. They're needed there.
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
wrc559
Posts: 118
Joined: Sun Mar 22, 2015 2:38 am
Location: Australia
Contact:

Re: SDelete with Uninst_UVK_AtLogon.uvk

Post by wrc559 »

Fred wrote:WRC, <SDelete> is a UVK scripting keyword, and thus is only understood by UVK. Windows does not recognize it.

Replace the last command with this one:

Code: Select all

%SystemDir%\schtasks.exe /create /tn "Delete RepairTool Folder On Startup" /tr "%ComSpec% /c rd /s /q '%Desktop%\Repair Tool Software'"
Don't forget the quotes around %Desktop%\Repair Tool Software. They're needed there.
Thank you, I appreciate your help.
wrc559
Posts: 118
Joined: Sun Mar 22, 2015 2:38 am
Location: Australia
Contact:

Re: SDelete with Uninst_UVK_AtLogon.uvk

Post by wrc559 »

Can't understanndddd coddesss, or i just did it all wrong.... Trying to schedule automatic UVK uninstall & software folder. UVK uninstalls, however files wont delete.
Still trying to get the system to delete files Automatically:


<UVKCommandsScript>
<RunWait> -h
%SystemDir%\schtasks.exe /create /tn "Uninstall UVK on startup" /tr "'%UVKDir%\UVK_en.exe' -Uninst -Auto" /ru System /sc ONSTART
%SystemDir%\schtasks.exe /create /tn "Uninstall UVK on startup" /tr "'%UVKDir%\UVK_en.exe' -Uninst -Auto" /ru System /sc ONSTART /rl HIGHEST /delay 0005:00 /f
%SystemDir%\schtasks.exe /create /tn "Delete RepairTool Folder On Startup" /tr "%ComSpec% /c rd /s /q '%Desktop%\Repair Tool Software'"
%SystemDir%\schtasks.exe /create /tn "Delete RepairTool Folder On Startup" /tr "%ComSpec% /c rd /s /q '%MyDocs%\Downloads\Repair Tool Software'"
%SystemDir%\schtasks.exe /create /tn "Delete RepairTool Folder On Startup" /tr "%ComSpec% /c rd /s /q '%MyDocs%\Downloads\Repair Tool Software.zip'"
%SystemDir%\schtasks.exe /create /tn "Delete RepairTool Folder On Startup" /tr "%ComSpec% /c rd /s /q '%UserProfile%\Downloads\Repair Tool Software'"
%SystemDir%\schtasks.exe /create /tn "Delete RepairTool Folder On Startup" /tr "%ComSpec% /c rd /s /q '%UserProfile%\Downloads\Repair Tool Software.zip'"
%SystemDir%\schtasks.exe /create /tn "Delete RepairTool Folder On Startup" /tr "%ComSpec% /c rd /s /q '%UserProfile%\Downloads\Repair _Tool_Software'"
%SystemDir%\schtasks.exe /create /tn "Delete RepairTool Folder On Startup" /tr "%ComSpec% /c rd /s /q '%UserProfile%\Downloads\Repair_Tool_Software.zip'"
Charger440
Posts: 1529
Joined: Sun May 25, 2014 7:44 am
Location: Missouri

Re: SDelete with Uninst_UVK_AtLogon.uvk

Post by Charger440 »

"/SC" does not have the value, "ONSTART." "/TN" is supposed to be a unique identifier and you are repeating the name several times therefore not making it unique.

This is according to MSDN documatation.
Jim

It is not "Can it be done?" but rather, "How can we do it?"
Fred
Site Admin
Posts: 2357
Joined: Sat Jul 30, 2011 12:05 pm
Location: Red coast, France
Contact:

Re: SDelete with Uninst_UVK_AtLogon.uvk

Post by Fred »

Jim, this is taken from a Windows command prompt help file in CHM format I downloaded from Microsoft.

Syntax:

Code: Select all

schtasks /create /sc <ScheduleType> /tn <TaskName> /tr <TaskRun> [/s <Computer> [/u [<Domain>\]<User> [/p <Password>]]] [/ru {[<Domain>\]<User> | System}] [/rp <Password>] [/mo <Modifier>] [/d <Day>[,<Day>...] | *] [/m <Month>[,<Month>...]] [/i <IdleTime>] [/st <StartTime>] [/ri <Interval>] [{/et <EndTime> | /du <Duration>} [/k]] [/sd <StartDate>] [/ed <EndDate>] [/it] [/z] [/f]
Parameters

Code: Select all

/sc <ScheduleType>
Specifies the schedule type. Valid values are MINUTE, HOURLY, DAILY, WEEKLY, MONTHLY, ONCE, ONSTART, ONLOGON, ONIDLE.
Thus the ONSTART value is valid for /SC. As for /TN, you're absolutely correct, and I didn't spot that one.

Jono,

You need to give each task a different name, except for the Uninstall UVK on startup ones. Those have the same name for this command to work on XP.

Additionally, you are using the RD (rmdir) command to delete files. That won't work. RD only removes folders. Use DEL /F /Q 'File Path' instead, for files.
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: 2357
Joined: Sat Jul 30, 2011 12:05 pm
Location: Red coast, France
Contact:

Re: SDelete with Uninst_UVK_AtLogon.uvk

Post by Fred »

I also noticed the file and folder removal commands don't have the /SC and /RU parameters (my fault, I guess).

Code: Select all

<UVKCommandsScript>
<RunWait> -h
%SystemDir%\schtasks.exe /create /tn "Uninstall UVK on startup" /tr "'%UVKDir%\UVK_en.exe' -Uninst -Auto" /ru System /sc ONSTART
%SystemDir%\schtasks.exe /create /tn "Uninstall UVK on startup" /tr "'%UVKDir%\UVK_en.exe' -Uninst -Auto" /ru System /sc ONSTART /rl HIGHEST /delay 0005:00 /f
%SystemDir%\schtasks.exe /create /tn "Delete RepairTool Folder On Startup" /tr "%ComSpec% /c rd /s /q '%Desktop%\Repair Tool Software'" /ru System /sc ONSTART
%SystemDir%\schtasks.exe /create /tn "Delete RepairTool Folder On Startup 2" /tr "%ComSpec% /c rd /s /q '%MyDocs%\Downloads\Repair Tool Software'" /ru System /sc ONSTART
%SystemDir%\schtasks.exe /create /tn "Delete RepairTool zip On Startup" /tr "%ComSpec% /c del /f /q '%MyDocs%\Downloads\Repair Tool Software.zip'" /ru System /sc ONSTART
%SystemDir%\schtasks.exe /create /tn "Delete RepairTool Folder On Startup 3" /tr "%ComSpec% /c rd /s /q '%UserProfile%\Downloads\Repair Tool Software'" /ru System /sc ONSTART
%SystemDir%\schtasks.exe /create /tn "Delete RepairTool zip On Startup 2" /tr "%ComSpec% /c del /f /q '%UserProfile%\Downloads\Repair Tool Software.zip'" /ru System /sc ONSTART
%SystemDir%\schtasks.exe /create /tn "Delete RepairTool Folder On Startup 4" /tr "%ComSpec% /c rd /s /q '%UserProfile%\Downloads\Repair _Tool_Software'" /ru System /sc ONSTART
%SystemDir%\schtasks.exe /create /tn "Delete RepairTool zip On Startup 3" /tr "%ComSpec% /c del /f /q '%UserProfile%\Downloads\Repair_Tool_Software.zip'" /ru System /sc ONSTART
The main problem with this code is that it will create several tasks and leave them in the system. Windows will run those tasks every time the system boots. Uninstall UVK on startup is not important, because UVK_en.exe no longer exists, but %Comspec% does exist, so it will be executed, increasing boot time.

I would remove those files immediately, instead, unless you have a problem with it.

Code: Select all

<UVKCommandsScript>
<RunWait> -h
%SystemDir%\schtasks.exe /create /tn "Uninstall UVK on startup" /tr "'%UVKDir%\UVK_en.exe' -Uninst -Auto" /ru System /sc ONSTART
%SystemDir%\schtasks.exe /create /tn "Uninstall UVK on startup" /tr "'%UVKDir%\UVK_en.exe' -Uninst -Auto" /ru System /sc ONSTART /rl HIGHEST /delay 0005:00 /f

%ComSpec% /c rd /s /q "%Desktop%\Repair Tool Software"
%ComSpec% /c rd /s /q "%MyDocs%\Downloads\Repair Tool Software"
%ComSpec% /c del /f /q "%MyDocs%\Downloads\Repair Tool Software.zip"
%ComSpec% /c rd /s /q "%UserProfile%\Downloads\Repair Tool Software"
%ComSpec% /c del /f /q "%UserProfile%\Downloads\Repair Tool Software.zip"
%ComSpec% /c rd /s /q "%UserProfile%\Downloads\Repair _Tool_Software"
%ComSpec% /c del /f /q "%UserProfile%\Downloads\Repair_Tool_Software.zip"
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: 2357
Joined: Sat Jul 30, 2011 12:05 pm
Location: Red coast, France
Contact:

Re: SDelete with Uninst_UVK_AtLogon.uvk

Post by Fred »

You guys can download the Windows command line reference here:
https://www.microsoft.com/en-us/downloa ... px?id=2632
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
Charger440
Posts: 1529
Joined: Sun May 25, 2014 7:44 am
Location: Missouri

Re: SDelete with Uninst_UVK_AtLogon.uvk

Post by Charger440 »

Fred

I did not realize you wrote the code that Jono was trying to get to work. To be honest with you it never occurred to me too download the windows command line documentation as I was looking at the MSDN documentation which should be newer. In this case it seems as though it was wrong though.

Glad you got it figured out for Jono though :)
Jim

It is not "Can it be done?" but rather, "How can we do it?"
wrc559
Posts: 118
Joined: Sun Mar 22, 2015 2:38 am
Location: Australia
Contact:

Re: SDelete with Uninst_UVK_AtLogon.uvk

Post by wrc559 »

Thank you;
Appreciate your support
Post Reply