Delete old files (vbscript)

This vbscript will delete all files older that 3 months in a specified folder and all subfolders. It will also create a log file with all processed folders and deleted files.

' Folder path
const fldname = "\\your\folder\path"
set fso = createobject("scripting.filesystemobject")
set fldr = fso.getfolder(fldname)
dttoday = date
tmnow = Time

'Calculate trigger date (change according to your requirements)
dtold = dateadd("m", -3, dttoday) 'files older than 3 months will be deleted

'    * yyyy - Year
'    * q - Quarter
'    * m - Month
'    * y - Day of year
'    * d - Day
'    * w - Weekday
'    * ww - Week of year
'    * h - Hour
'    * n - Minute
'    * s - Second

'    Log File
Set LogFSO = CreateObject("Scripting.FileSystemObject")
FileName = Year(dttoday)&"."&Month(dttoday)&"."&Day(dttoday)&"-"&Hour(tmnow)&"."&Minute(tmnow)&"."&Second(tmnow)&".txt"
Set LogFile = LogFSO.OpenTextFile(FileName, 2, True)

recurse fldr  
sub recurse( byref fldr)
dim subfolders,files,folder,file
set subfolders = fldr.subfolders
set files = fldr.files
for each file in files
if file.datelastmodified < dtold then
LogFile.WriteLine("     DELETING - " & & " LAST MODIFIED: " & file.datelastmodified)
on error resume next
end if
for each folder in subfolders
recurse folder
set subfolders = nothing
set files = nothing
end sub

Configure NTP Time Service on Windows Server DC

To configure an authoritative NTP Time Server (on Windows Server Domain Controller) to synchronize with an external NTP time source, edit following Windows registry entries:

Change the time server type to NTP
Set to NTP
NTP stands for Network Time Protocol

Set AnnounceFlags to 5
Set to 5
Announce flag values:
0 Timeserv_Announce_No, Reliable_Timeserv_Announce_No. The domain controller does not advertise time service.
1 Timeserv_Announce_Yes. The domain controller always advertises time service.
2 Timeserv_Announce_Auto. The domain controller automatically determines whether it should advertise time service.
4 Reliable_Timeserv_Announce_Yes. The domain controller will always advertise reliable time service.
8 Reliable_Timeserv_Announce_Auto. The domain controller automatically determines whether it should advertise reliable time service.
Flag 5 (1+4) means "The domain controller always advertises time service" and "The domain controller will always advertise reliable time service".

MS Exchange 2003 ActiveSync Mobile Administration Tool

By using the Exchange ActiveSync Mobile Administration Web tool, administrators can perform the following actions:

  • View a list of all devices that are being used by any enterprise user.
  • Select/de-select devices to be remotely erased / wiped.
  • View the status of pending remote erase requests for each device.
  • View a transaction log that indicates which administrators have issued remote erase commands, in addition to the devices those commands pertained to.

The tool needs to be installed on an Exchange Server 2003 with Service Pack 2 front-end server.

  1. Download the Administration Tool
  2. Install on an Exchange Front End Server
  3. browse to https://localhost/mobileadmin/
  4. log-on using exchange administrator credentials

If [Wipe] option is not available you need to enable the "Enforce Password on Device" in the Exchange System Manager of Exchange
ESM > Global Settings > Mobile Services > Properties > Device Security > Enforce password on device
You can left all other fields unchecked to avoid actually enforcing password policy.
Mobile device users will be forced to accept new security policy and may be forced to change they mobile device security code.

If you are getting error "Failed to access user's Mailbox, verify that the mailbox and user account are enabled and functional." make sure that "Integrated Windows authentication" is enabled in:
Internet Information Services (IIS) Manager > Web Sites > Default Web Site > Exadmin > Properties > Directory security > Authentication and access control > Edit

For more information check:

Exchange Server 2007 has this functionality built in to Exchange Management Console
EMC > Recipient Configuration > Mailbox > [user name] > Manage mobile device

Exchange Server 2003 SP3

Installing PHP 5.2 on IIS6


1. Extract into C:\PHP

2. Rename "php.ini-recomended" into "php.ini"

3. Edit php.ini

extension_dir = "C:\PHP\ext"

[mail function]
SMTP = <SMTP server IP address>
smtp_port = 25
sendmail_from = This email address is being protected from spambots. You need JavaScript enabled to view it.

4. My Computer > System Properties > Advanced > Environment Variables > Path
Add <;C:\PHP> at the end.

5. Reboot the server

6.  Execute (cmd): cscript "C:\Windows\system32\iisext.vbs" /AddFile c:\PHP\php5isapi.dll 1 PHPISAPI 1 PHP-ISAPI (This script creates a new Web Service Extension named "PHP-ISAPI" with a status of "Allowed".

7. IIS Manager > Web Sites > Your_Site > Properties > Home Directory > Configurations > Add
Locate C:\PHP\php5isapi.dll
Enter .php as the Extension


To display PHP errors (for debugging)
php.ini set: display_errors = on

Enable GD (For secireimage, etc)
1. php.ini uncomment: extension=php_gd2.dll
2. Copy file php_gd2.dll from C:\PHP\ext to C:\Windows
3. iisreset

Enable msql (Connection to MS SQL server)
1. php.ini uncomment: extension=php_msql.dll
2. Copy file php_msql.dll from C:\PHP\ext to C:\Windows
3. iisreset
4. If connection fails with "Unable to connect to server" copy ntwdblib.dll from \System32 on SQL server to \System32 on PHP server
Explanation: php_msql.dll extension requites MS SQL client tools to be installed on IIS/PHP server. Alternatively you can copy ntwdblib.dll from SQL server to IIS/PHP server (System 32 directory). This will enable access through named pipes.

Windows Server 2003


Subscribe to receive occasional updates on new posts.
Your email will not be used for any other purpose and you can unsubscribe at any time.
Please wait