| |
mbouchard
Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
|
While it seems that it might be difficult, if you take this in steps and get each part working, putting it together shouldn't be to hard. First, get the WSH Documentation linked in my Sig, this should provide you will all the examples you need to write your script. Like I said, do this in steps, each step would be it's own script. quote:
I need to be able to check that the file exists For this, take a look at FileExists, you code would look something like this: If Fso.FileExists("C:\somefolder\somefile.txt") then Msgbox "Blah" Else Msgbox "No Blah" End If quote:
If it does check the "deployment.user.cachedir=" property Where is this info stored? quote:
If that exists check against the current logged on user to make sure it equals the above path. To get this, use WshNetwork (UserName), again look in the WSH docs, there will be an example. But it would look something like this: strPath = "C:\Documents and Settings\USERSNAME\Local Settings\Temp'This would be taken from above strUser = WshNetwork.Username If lcase("C:\Documents and Settings\" & strUSer & "\Local Settings\Temp) = lcase(strPath) then Msgbox "Yup" Else Msgbox "nope" End If Once you have each part working, then you would start to put them together. You could nest them, i.e. have each if then end if inside of another or you could use variables, something like this. strVar1 = False strVar2 = False etc If A = true Then strVar1 = True End If If strVar1 = True then If B = "something" then strVar2 = True End If End If If strVar2 = True then If C = "blah" then Write what you need here End If End If hopefully this will give you a starting point. Give it a try and post here if you have any issues
_____________________________
Mike For useful Scripting links see the Read Me First stickey! Always remember Search is your friend.
|
|