Scripts and Permissioning
I got a call a couple of weeks ago about a backup program not working quite the way a client had wanted. As I had installed it for him, I looked at the program a bit closer. I almost always run an application on my own computers before installing it on anyone else’s computer. It’s really the only way to feel out a program – is it going to DO what it says? Cause issues with other applications? Be effective overall?
The app was working as a test smoothly on my computer, but certainly wasn’t doing the job as intended on his small business computer. As a matter of fact, it had only done 1 backup period – the day I installed it. And that isn’t QUITE what the customer was looking for. And worse, was creating a situation that was putting the data in jeopardy should anything detrimental happen TO the main computer.
I’ve spent a lot of time programming web and misc system utility items and for years now, have done this via VBScript. Web programming is a given for VBScript, but many times system utility stuff is done with a heavier language like Visual Basic (VB), VB.NET or C# these days. And then there is PowerShell – which is probably what I should be using these days, but alas, old habits die hard.
So why use VBScript? It’s light, doesn’t require a whole lot of deep thought, doesn’t require any compiling, and most important, can be adjusted on the fly to suit most any need (in most cases). VBScript is a text based way of programming stuff, meaning that it is really just a text file with a VBS extension that is run with either the CSCRIPT or WSCRIPT application. As a matter of fact, anybody can create a VBS file with Notepad and run it! Easy, easy, easy.
So instead of fighting with user interfaces, menus, options and someone else’s way of thinking, I opted to just go with or create a simple backup program in VBScript. Backup programs essentially do nothing more than copy a selected group of files or folders to another location for safekeeping – usually putting a date tag on them somehow. There are far more elaborate routines that track versions and mod dates in databases and all that, but truthfully, people in general just want to be able to look at prior saved versions of their work. If you know the document that you had accidentally deleted was there yesterday, and your backup should have picked it up last night, then all you have to do is go to the backup location and bring it back over. Simple.
Sadly, I had written one of these before to do an hourly backup of my working files at one of my prior jobs, but couldn’t find it at the moment – very sad. So after a couple of hours, I had what I thought would be more than adequate to do a nice simple backup on a given folder. Tested out smoothly on my Vista machine and invariably would work well on my XPs as well.
So, went over to the customer site with the little app on a thumb drive, copied it over and voila! “You don’t have permission to create…” Huh. WTF? Modified permissions here and there to ensure that the appropriate user should have full perms on the destination folder and still the same thing. For about 20 minutes went through this. Tried removing the UAC protection. Nope. Won’t even go into all the different things I tried. Likely it’s going to be something simple I overlooked in the permissions. But when you’re sitting in front of the client’s computer and under the gun to get things done, these things NEVER work out.
So, today, I’ll be figuring out what went wrong and probably remotely installing it so I can have all my goody tools on hand while I watch it fail.
Nothing simple is ever easy.