All Forums >> [Scripting] >> WSH & Client Side VBScript >> VBS - Script doesnt work over my Network LAN? Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
When I try execute a vbscript from another computer over a shared connection, it gives me "Permission Denied Code 0". Is there a way of getting the script to work?
Heres the code snippet:
quote:
Dim WSHShell
const forreading=1, forwriting=2, forappending=8
set wshshell = wscript.createobject("wscript.shell") set wshnet = createobject("wscript.network") set filesys = createobject("scripting.filesystemobject") set filetxt = filesys.opentextfile("log.txt", forappending, true)
^^^ Works perfectly when I run this off my Desktop, Documents... and pretty much anywhere off of C Drive [C:\] ... but when I try execute it from another computer over a Network LAN... PROBLEMS!
Any ideas?
Actually, you know what would be really nice, is if there was a special way of getting this script to work over the Network LAN without having to touch Read / Write Permissions... if that's what's causing the problem in the first place. The reason I want to know this is because I plan on implementing this... idk... lets call it a "read-write bypass"... on the LANM (LAN Messenger) I talked about in my Introduction thread.
When I publish the first version of my LAN Mesenger program, I would like it to function in such a way that doesn't require the user to edit his Nerwork LAN read-write permissions... if that is what's causing the issues?
I'll post a prototype of the program later on when I figure out how to encrypt / archive the code ;)
When I try execute a vbscript from another computer over a shared connection, it gives me "Permission Denied Code 0". Is there a way of getting the script to work?
Heres the code snippet:
quote:
Dim WSHShell
const forreading=1, forwriting=2, forappending=8
set wshshell = wscript.createobject("wscript.shell") set wshnet = createobject("wscript.network") set filesys = createobject("scripting.filesystemobject") set filetxt = filesys.opentextfile("log.txt", forappending, true)
^^^ Works perfectly when I run this off my Desktop, Documents... and pretty much anywhere off of C Drive [C:\] ... but when I try execute it from another computer over a Network LAN... PROBLEMS!
Any ideas?
Actually, you know what would be really nice, is if there was a special way of getting this script to work over the Network LAN without having to touch Read / Write Permissions... if that's what's causing the problem in the first place. The reason I want to know this is because I plan on implementing this... idk... lets call it a "read-write bypass"... on the LANM (LAN Messenger) I talked about in my Introduction thread.
When I publish the first version of my LAN Mesenger program, I would like it to function in such a way that doesn't require the user to edit his Nerwork LAN read-write permissions... if that is what's causing the issues?
I'll post a prototype of the program later on when I figure out how to encrypt / archive the code ;)
Help will be appeciated greatly!
-Josh
The code above opens a file called "log.txt" for appending, in whatever location the script is being run from. if you give it a full path to a log.txt file, say:
That shoudl take care of your read/write issues.
_____________________________
"Would you like to touch my monkey?" - Dieter (Mike Meyers)
"It is better to die like a tiger, than to live like a pussy." -Master Wong, from Balls of Fury
When I try execute a vbscript from another computer over a shared connection, it gives me "Permission Denied Code 0". Is there a way of getting the script to work?
Heres the code snippet:
quote:
Dim WSHShell
const forreading=1, forwriting=2, forappending=8
set wshshell = wscript.createobject("wscript.shell") set wshnet = createobject("wscript.network") set filesys = createobject("scripting.filesystemobject") set filetxt = filesys.opentextfile("log.txt", forappending, true)
^^^ Works perfectly when I run this off my Desktop, Documents... and pretty much anywhere off of C Drive [C:\] ... but when I try execute it from another computer over a Network LAN... PROBLEMS!
Any ideas?
Actually, you know what would be really nice, is if there was a special way of getting this script to work over the Network LAN without having to touch Read / Write Permissions... if that's what's causing the problem in the first place. The reason I want to know this is because I plan on implementing this... idk... lets call it a "read-write bypass"... on the LANM (LAN Messenger) I talked about in my Introduction thread.
When I publish the first version of my LAN Mesenger program, I would like it to function in such a way that doesn't require the user to edit his Nerwork LAN read-write permissions... if that is what's causing the issues?
I'll post a prototype of the program later on when I figure out how to encrypt / archive the code ;)
Help will be appeciated greatly!
-Josh
The code above opens a file called "log.txt" for appending, in whatever location the script is being run from. if you give it a full path to a log.txt file, say:
That shoudl take care of your read/write issues.
Hi DiGiTAL.SkReAM,
I don't have a LAN set up at the moment, but as soon as I get this tested to see if it works, I'll get back to you.