|
-
Feb 12th, 2004, 10:16 PM
#1
Thread Starter
Frenzied Member
edit hosts file
I want to be able to apply a "patch" to a users computer to change their hosts file so that they can put in a keyword to access my server on our local intranet.
Is this possible with Javascript?
Also, could I tell which version of windows is being used and possibly the Windows directory?
-
Feb 13th, 2004, 05:30 AM
#2
Frenzied Member
JavaScript can definately not detect what version of windows in running and what folder it is in. but surely in an intranet, it would be the same on every pc.
JavaScript cannot edit/move/create/delete files either
Have I helped you? Please Rate my posts. 
-
Feb 13th, 2004, 07:49 AM
#3
Thread Starter
Frenzied Member
>>but surely in an intranet, it would be the same on every pc.
Surely you're joking, right? I'm talking about several hundred PCs all at different levels of upgrades.
And if I can't edit files using Javascript, what should I use?
-
Feb 13th, 2004, 07:52 AM
#4
Frenzied Member
PHP, or Java could maybe do it. ActiveX can, I think. I'd think VB would be the best app to run though. I'd ask this question in the VB forum, being more specific with what you want the "patch" to do.
Have I helped you? Please Rate my posts. 
-
Feb 13th, 2004, 07:58 AM
#5
Thread Starter
Frenzied Member
PHP is server side only! How would it get the browser to access the file?
-
Feb 13th, 2004, 07:59 AM
#6
Frenzied Member
OK, my mistake, maybe PHP won't do it. VB and ActiveX should though.
Have I helped you? Please Rate my posts. 
-
Feb 13th, 2004, 08:00 AM
#7
Thread Starter
Frenzied Member
Do you really think I'd ask this here if I wanted a VB solution? I want to make it so that they can go to a website, click a button and .... "wa la" all is fine and dandy.
-
Feb 13th, 2004, 08:01 AM
#8
-
Feb 13th, 2004, 08:15 AM
#9
Java and PHP are server-side only. And only a fool would give ActiveX the authority to have file access. This is something that just isn't feasible from a web app, unless it's in an intranet setting where the software can be trusted.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Feb 13th, 2004, 08:18 AM
#10
Frenzied Member
so really it should be VB or C?
Have I helped you? Please Rate my posts. 
-
Feb 13th, 2004, 08:48 AM
#11
Thread Starter
Frenzied Member
Originally posted by crptcblade
This is something that just isn't feasible from a web app, unless it's in an intranet setting where the software can be trusted.
Exactly. It is on our intranet. Neither the database or this patch would be accessible to outside users. SOO... the software can be trusted.
So do you know of a way to get this done?
-
Feb 13th, 2004, 09:43 AM
#12
As was said before, use ActiveX. Read up on File Scripting Objects.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Feb 13th, 2004, 09:47 AM
#13
Thread Starter
Frenzied Member
OK, I have to be honest. I don't know is meant when someone says "use ActiveX". Does that mean create a DLL, or does that mean I have to create some kind of control like in VB?
And how is that deployed?
-lost, confused, in need of help.
-
Feb 13th, 2004, 09:55 AM
#14
I've never used ActiveX on a website before, but there should be no need to deploy anything as long as you are not doing anything fancy.
Just use VBScript to run the FSO...
VB Code:
Sub UpdateFile
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
'run your update code
Set fso = Nothing
End Sub
And you should be able to call the sub just as you would call a javascript function.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Feb 13th, 2004, 09:58 AM
#15
Thread Starter
Frenzied Member
Do I need to have anything special setup on the server to handle vbscript? (I'm assuming you might not know this if you've never used it in a web arena).
-
Feb 13th, 2004, 10:31 AM
#16
Frenzied Member
no, VbScript should work straight away, though only in IE. on an intranet I don't think that matters though,
Have I helped you? Please Rate my posts. 
-
Feb 13th, 2004, 10:33 AM
#17
Thread Starter
Frenzied Member
I'm getting errors that it cannot create the FSO
-
Feb 13th, 2004, 10:45 AM
#18
Frenzied Member
sorry, but I don't know how to use ActiveX in web pages, try google.
Have I helped you? Please Rate my posts. 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|