I am an extreme new comer to C++. Currently I have written a short script in VBscript to delete two specific files on a specific day. This script is set in the start up menu so that it checks for the day of the week. If the day matches the set day it deletes the two files that I need it two. The reason that I have set it up like this is due to another program that starts shortly after the computer starts and these two files need to be deleted prior to the other program starting. Where I am stuck at is assigning the day of the week to an int value and then deleting the file. Below is the code that I used in VBscript.
strComputer = "."
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_LocalTime")
For Each objItem in colItems
If objItem.DayOfWeek=4 then
objFSO.DeleteFile("C:\system folder\folder\file name")
End if
If objItem.DayOfWeek=4 then
objFSO.DeleteFile("C:\system folder\folder\file name")
End if
Next
Yes this script deletes the files on Thursday. The computer type that I am trying to set this up does not have all of the libs for VBscript, so I am forced to learn another language. Please help.