Jump to content

Recommended Posts

Posted (edited)

Hi we have a vbs script that's been working fine but all of a sudden has stopped working, the error is on line 84 char 23 but I cannot figure out for the life of me what the issue is, here is the code.

 

line 84 is fso.DeleteFolder path,True

 

ar.Open Sql, cnn 'on error resume Next If Not (ar.Eof and ar.Bof ) Then ar.MoveFirst Do until ar.EOF username="ar.fields[0].value" path="\\am-fp01\users" & username If fso.FolderExists path Then fso.DeleteFolder path,True End If Loop End If

 

Thanks in advance for any input.

Edited by NeoMagic
Posted
[/color]Sub oldusers	Set cnn = CreateObject("ADODB.Connection")	Set ar = CreateObject("adodb.recordset")	cnn.ConnectionString = ConnStr	cnn.Open	sql="select username from logins_users where userid in (select ts_user from timesheets where ts_date < (CURRENT_DATE - INTERVAL 60 DAY)) and userid not in (select ts_user from timesheets where ts_date >= (CURRENT_DATE - INTERVAL 60 DAY))"	ar.Open Sql, cnn	'on error resume Next	If Not (ar.Eof and ar.Bof ) Then 		ar.MoveFirst		Do until ar.EOF		username="ar.fields[0].value"		path="\\am-fp01\users\" & username		If fso.FolderExists path Then		fso.DeleteFolder path,True		End If 		Loop	End If	End Sub[color=#333333]

 

error.png

Posted

Thanks that was it, the previous line didn't have quotation marks either that was my first issue odd though this script hasn't changed in ages.

 

Thanks for your help.

  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...