Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


VBS - Script doesnt work over my Network LAN?

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,60305
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
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!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 VBS - Script doesnt work over my Network LAN? - 5/16/2008 3:14:57 PM   
  TKS


Posts: 187
Score: 0
Joined: 5/16/2008
Status: offline
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)

scomputername = wshnet.computername

filetxt.writeline scomputername
filetxt.writeline ("")
filetxt.close

wshshell.run "log.txt", 3, false

set wshshell = nothing
wscript.quit(0)


^^^ 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
 
 
Post #: 1
 
 RE: VBS - Script doesnt work over my Network LAN? - 5/16/2008 3:19:22 PM   
  TKS


Posts: 187
Score: 0
Joined: 5/16/2008
Status: offline
- deleted -

< Message edited by TKS -- 5/17/2008 12:37:32 AM >

(in reply to TKS)
 
 
Post #: 2
 
 RE: VBS - Script doesnt work over my Network LAN? - 5/16/2008 3:23:36 PM   
  TKS


Posts: 187
Score: 0
Joined: 5/16/2008
Status: offline
Wait, wait... perhaps, if the problem is READ / WRITE permissions, which it probably is...

Can anyone suggest a work around?

Work arounds are also greatly appreciated!

(in reply to TKS)
 
 
Post #: 3
 
 RE: VBS - Script doesnt work over my Network LAN? - 5/18/2008 1:18:52 AM   
  DiGiTAL.SkReAM


Posts: 1184
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
quote:

ORIGINAL: TKS

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)

scomputername = wshnet.computername

filetxt.writeline scomputername
filetxt.writeline ("")
filetxt.close

wshshell.run "log.txt", 3, false

set wshshell = nothing
wscript.quit(0)


^^^ 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

(in reply to TKS)
 
 
Post #: 4
 
 RE: VBS - Script doesnt work over my Network LAN? - 5/18/2008 1:18:25 PM   
  TKS


Posts: 187
Score: 0
Joined: 5/16/2008
Status: offline
quote:

ORIGINAL: DiGiTAL.SkReAM

quote:

ORIGINAL: TKS

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)

scomputername = wshnet.computername

filetxt.writeline scomputername
filetxt.writeline ("")
filetxt.close

wshshell.run "log.txt", 3, false

set wshshell = nothing
wscript.quit(0)


^^^ 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.

Thanks in advance.

-TKS

(in reply to DiGiTAL.SkReAM)
 
 
Post #: 5
 
 RE: VBS - Script doesnt work over my Network LAN? - 5/22/2008 7:47:00 AM   
  mcds99


Posts: 434
Score: 4
Joined: 2/28/2006
Status: offline
VBSscript requires admin rights on the remote machine.

_____________________________

Sam

Keep it Simple Make it Fun KiSMiF

(in reply to TKS)
 
 
Post #: 6
 
 RE: VBS - Script doesnt work over my Network LAN? - 5/22/2008 3:29:27 PM   
  DiGiTAL.SkReAM


Posts: 1184
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
He isn't trying to execute the script on a remote machine, he is trying to execute a script that is located on a remote machine, on his local machine.

Confused yet? heheheh

_____________________________

"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

(in reply to mcds99)
 
 
Post #: 7
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> VBS - Script doesnt work over my Network LAN? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts