Results 1 to 17 of 17

Thread: VBScript on the mapped drive

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 1999
    Posts
    229

    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

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    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]

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 1999
    Posts
    229
    Thanks for the reply plenderj,

    Is there any solution for this one? Anyone?

    Thanks in advance
    Keiko

  4. #4
    Hyperactive Member FATBOYPEE's Avatar
    Join Date
    May 2001
    Location
    Charleville (Ireland) Still. ANYONE GOT A JOB I CAN HAVE ? GIZA JOB. I CAN DO THAT....
    Posts
    463
    Where's the Script RUNAT pointing to ? IS there a Server involved anywhere (IIS??)...

    Best Bar.....

  5. #5
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    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]

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Sep 1999
    Posts
    229
    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

  7. #7
    Hyperactive Member FATBOYPEE's Avatar
    Join Date
    May 2001
    Location
    Charleville (Ireland) Still. ANYONE GOT A JOB I CAN HAVE ? GIZA JOB. I CAN DO THAT....
    Posts
    463
    <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.....

  8. #8
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    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.

  9. #9
    Hyperactive Member FATBOYPEE's Avatar
    Join Date
    May 2001
    Location
    Charleville (Ireland) Still. ANYONE GOT A JOB I CAN HAVE ? GIZA JOB. I CAN DO THAT....
    Posts
    463
    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.....

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    Sep 1999
    Posts
    229
    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

  11. #11
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    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 .

  12. #12

    Thread Starter
    Addicted Member
    Join Date
    Sep 1999
    Posts
    229
    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

  13. #13
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    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 .

  14. #14

    Thread Starter
    Addicted Member
    Join Date
    Sep 1999
    Posts
    229
    Thanks BuggyProgrammer for the suggestion.

    Is there any other suggestion by using front-end scripting languages (javascript, vbscript)?

    Thanks in advance.
    Keiko

  15. #15
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    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 .

  16. #16
    Hyperactive Member FATBOYPEE's Avatar
    Join Date
    May 2001
    Location
    Charleville (Ireland) Still. ANYONE GOT A JOB I CAN HAVE ? GIZA JOB. I CAN DO THAT....
    Posts
    463
    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.....

  17. #17

    Thread Starter
    Addicted Member
    Join Date
    Sep 1999
    Posts
    229

    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
  •  



Click Here to Expand Forum to Full Width