I've inherited a VBScript that runs every 1 minute and causes 100% CPU usage. I can't modify the code as it's a production server and there is no testing environment. So I'd like to have your opinion before I propose the change.
Basically the script loops through all files in the source folder (around 7000 files)checking file names and if it starts with "D__" it will copy the file to destination folder. I notice the script runs: mid(ucase()) which is better, I think, as ucase(mid)) or even left()="D__" or left()="d__" to avoid string manipulation.
It also checks if the file exists in the destination which is no use since the overwrite flag is set to false in copyfile().
If I make these changes, will there be any performance? and if I write a small app in C# for example, will it run faster or it isn't VBScript limitation?