Brain-dead moment.
Got the below code:
Code:
<script type="text/vbscript">
<!--
sub dean()
Set Shell = CreateObject("WScript.Network")
Shell.MapNetworkDrive "r:", "\\machineName\c$"
end sub
' -->
</script>
How can I call that from an ASP page?
Cheers,
Dean
Hmm, if its on the same page or in a include file:
Call dean()
or
dean()
I haven't used the Sub format to often, I usually stick to the Function format.
Was this answer helpful ?
Yes No
I thought as much but for some reason it doens't like it.
Just get:
Type mismatch: 'dean'
Cheers,
Dean
Was this answer helpful ?
Yes No
Well, a quick google search says you jsut do: dean
if that doesn't work try switching it to a function.
Was this answer helpful ?
Yes No
are you trying to call that VB script function
from between <%%> tags?
you cant do that

Was this answer helpful ?
Yes No
Bugger.
Was hoping I wouldn't get that answer.
If I put this code:
Code:
Set Shell = CreateObject("WScript.Network")
Shell.MapNetworkDrive "r:", "\\lcfax\c$"
between <% %> tags I get Access Denied.
Ah well; back to the drawing board.
Cheers,
Dean
Was this answer helpful ?
Yes No
no problem, sorry to be the one to pass the bad news

Was this answer helpful ?
Yes No
Ah ha!
Got it. Wasn's supply a username/password via the serverside code; when doing it as clientside it already had the correct credentials.
Obvious now I think about it!
Cheers,
Dean
Was this answer helpful ?
Yes No