Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Login script for changing java deployment.properites

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,24578
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Login script for changing java deployment.properites
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Login script for changing java deployment.properites - 8/8/2005 10:36:42 PM   
  wazh

 

Posts: 1
Score: 0
Joined: 8/8/2005
Status: offline
Hi All,
I have a problem. I need a script that will fix a roaming issue I have with Java.
Java by default 1.5.0_xx saves the cache in docs and settings\application data\sun\java\deployment. However if you have a roaming profile due to the fact that it caches all the java info here then it tends to blow it out to a huge size. I would like to be able to change the default to the C\:\\Documents and Settings\\%username%\\Local Settings\\Temp. That way it wouldnt be included in the profile and everything would be sweet.
However the problem is that most of the time.
A: the file doesnt exist
B: if it does exist then the deployment.user.cachedir= doesnt exist.
C: I need to be able to query the current user and search and replace the deployment.properties file and then write this back to the local user that is logged in.
I think I would like to write this for a login script so that I can have it changed no matter what and apply it against a group policy.

I need to be able to check that the file exists. If it does check the "deployment.user.cachedir=" property. If that exists check against the current logged on user to make sure it equals the above path. If not. Write the property into the file.
 
The seems a little hard. Is anyone there that could give me some help with this problem?
 
So Many Thanks!

 
 
Post #: 1
 
 RE: Login script for changing java deployment.properites - 8/8/2005 11:56:36 PM   
  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.

(in reply to wazh)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Login script for changing java deployment.properites Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts