NeoMagic Posted May 17, 2018 Posted May 17, 2018 (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 May 17, 2018 by NeoMagic
NeoMagic Posted May 17, 2018 Author Posted May 17, 2018 [/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]
NeoMagic Posted May 17, 2018 Author Posted May 17, 2018 For some reason I can't post the code in its actual layout, I'll screenshot it
Bedders Posted May 17, 2018 Posted May 17, 2018 On your line If fso.FolderExists path Then Should it be If fso.FolderExists(path) Then 1
NeoMagic Posted May 17, 2018 Author Posted May 17, 2018 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. 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now