|
-
Jul 8th, 2002, 03:18 AM
#1
Thread Starter
Addicted Member
VBScript on the mapped drive
Dear all,
Let's say I have 2 PCs: A and B.
I shared one of the folder of B PC as X drive.
I placed an a.htm with this source inside X drive:
'-----------------
<script language="VBScript">
msgbox("A")
Set f = CreateObject("Scripting.FileSystemObject")
msgbox("B")
</script>
'-----------------
How come the CreateObject statement is not executed at all
when I call the file from the mapped drive (from A PC)?
I tried it on my C drive (of my A PC) and it works.
How to overcome this problem if we want to place a shared script in the shared/mapped drive?
Looking forward for your reply.
Thanks in advance.
Keiko
-
Jul 8th, 2002, 03:25 AM
#2
Retired VBF Adm1nistrator
Well that's probably a security thing ya know.
Being allowed to execute scripts from any origin could be dangerous.
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Jul 8th, 2002, 03:28 AM
#3
Thread Starter
Addicted Member
Thanks for the reply plenderj,
Is there any solution for this one? Anyone?
Thanks in advance
Keiko
-
Jul 8th, 2002, 03:31 AM
#4
Hyperactive Member
Where's the Script RUNAT pointing to ? IS there a Server involved anywhere (IIS??)...

Best Bar.....
-
Jul 8th, 2002, 03:33 AM
#5
Retired VBF Adm1nistrator
Something you might wanna look at is, in Internet Explorer, Tools > Internet Options > Security.
Then check what location would IE think the script is located on, then check if that location can run scripts
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Jul 8th, 2002, 03:37 AM
#6
Thread Starter
Addicted Member
Hi FATBOYPEE,
There is no webserver involve.
The second PC is acting as a server with a shared drive.
Is there any solution for this one?
Looking forward for your reply.
Thanks in advance
Keiko
-
Jul 8th, 2002, 04:00 AM
#7
Hyperactive Member
<code>
<script language="VBScript"<runat="server">
</Code>
Try it ? IT may work ? Suggest the script is being called by your client but without the use of 'server' it doesn't know where to execute ?
Not sure if my logic stands up here but it may work...(ca'nt test it this side)...
Peeman

Best Bar.....
-
Jul 8th, 2002, 05:10 AM
#8
Originally posted by FATBOYPEE
<code>
<script language="VBScript"<runat="server">
</Code>
Try it ? IT may work ? Suggest the script is being called by your client but without the use of 'server' it doesn't know where to execute ?
Not sure if my logic stands up here but it may work...(ca'nt test it this side)...
Peeman
I don't think it will work, because there is no webserver involved. And if it would work, it would probably not solve his problem (wouldn't the messagebox be displayed on the server?).
I think the problem is that security settings of internet explorer prevent running the script, just like plenderj said.
Check the zone internet explorer is using for the page (right most panel in the statusbar). Doubleclick the icon, and check the security settings.
-
Jul 8th, 2002, 05:26 AM
#9
Hyperactive Member
Originally posted by Frans C
I don't think it will work, because there is no webserver involved. And if it would work, it would probably not solve his problem (wouldn't the messagebox be displayed on the server?).
I thought that, that was wot would be required by the CreateObject ? Otherwise there'd be no point in using the other machine if al lyou wanted to do was use an FSO object on yer own drive ?
Accept the point on the Webserver, this was my initial thought too but still, worth a try ? Can't see exactly what the WebServer is doing other than executing the script, ergo, the webserver acts to cache/pool execution calls ? If that is not required, logically, what's to stop one machine referencing another and running the script, perhaps its ignorance on my part .......
Peeman.

Best Bar.....
-
Jul 9th, 2002, 07:47 PM
#10
Thread Starter
Addicted Member
Thanks FATBOYPEE and Frans C for the replies, but it doesn't work also.
The reason I put the script in other machine is to cut down redundancy, so all users can use the same shared script.
Any other suggestions ..... anyone?
Thanks in advance
Keiko
-
Jul 9th, 2002, 08:32 PM
#11
The picture isn't missing
VBScript doesn't allow stuff like that since it breaks security stuff because you can make files and delete files. i think you would want Windows Script, which is something like VBcode in a file with a .vbs ending. then you can run the file and use CreateObject.
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Jul 9th, 2002, 09:07 PM
#12
Thread Starter
Addicted Member
Hi BuggyProgrammer,
I tried by using vbs before, but it is not embedded with HTML code. It will ask me to either Open or Save.
I called it using:
<html><body><script language="JavaScript">
window.open("o:\\a.vbs");
</script></body></html>
Is there any command to execute an external file, not using window.open command? It is okay to have a prompt "You are running ActiveX .....".
Looking forward for your reply.
Thanks in advance
Keiko
-
Jul 9th, 2002, 09:10 PM
#13
The picture isn't missing
then make a VB dll and run it as an ACTIVEX control in the page
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Jul 9th, 2002, 09:19 PM
#14
Thread Starter
Addicted Member
Thanks BuggyProgrammer for the suggestion.
Is there any other suggestion by using front-end scripting languages (javascript, vbscript)?
Thanks in advance.
Keiko
-
Jul 9th, 2002, 09:23 PM
#15
The picture isn't missing
it isn't possible with ANY browser front end language. what if a browser didn't stop anyone from using FSO? a script kiddie can just copy some VB script into his website and when you visit his site it will delete all your files, or write a virus and changing your autoexec.bat to run it on startup. so either learn Java or make your own dll.
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Jul 10th, 2002, 02:58 AM
#16
Hyperactive Member
Originally posted by Keiko
Thanks FATBOYPEE and Frans C for the replies, but it doesn't work also.
The reason I put the script in other machine is to cut down redundancy, so all users can use the same shared script.
Any other suggestions ..... anyone?
Thanks in advance
Keiko
Is there no way you can put NT Server/Win2K server on the machine running the script, or put the script on a server ? My main suggestion is to set yerself up an IIS instance. Its not difficult to do & would save you loads of head-pain...
Peeman

Best Bar.....
-
Jul 10th, 2002, 08:07 PM
#17
Thread Starter
Addicted Member
VBScript on the mapped drive **session is closed**
Thanks all for your replies. Seems there is no direct solution.
I am going to close the session.
Thanks again
Keiko
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
|