Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


copyfile to remote workstation trouble

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> copyfile to remote workstation trouble
  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 >>
 copyfile to remote workstation trouble - 3/28/2006 8:54:38 AM   
  sirjadin26

 

Posts: 4
Score: 0
Joined: 3/20/2006
Status: offline
 
The following script works no problem when I am moving files locally on our LAN but for some reason if I leave our lan and head out onto the WAN I get "Path not found" error.  Any assistance would be greatly appreciated.

p1 is the anme of the file
p2 is the IP address of the workstation or box
p3 is the destination folder at that IP address


Dim objFSO, objFolder
On Error Resume Next
set wshell = CreateObject("Wscript.Shell")
set network = CreateObject("WScript.Network")
p1 = WScript.Arguments(0)
p2 = WScript.Arguments(1)
p3 = WScript.Arguments(2)
Const OverwriteExisting = TRUE
network.MapNetworkDrive "N:", strShare
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "C:\pdf\"&p1 ,"\\"&p2&"\"&p3&"\", OverwriteExisting
WSCRIPT.QUIT
 
 
Post #: 1
 
 RE: copyfile to remote workstation trouble - 3/28/2006 8:56:25 AM   
  ebgreen


Posts: 5246
Score: 31
Joined: 7/12/2005
Status: offline
what line do you get the path not found error on? Why do you map a drive then not use the mapping?

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to sirjadin26)
 
 
Post #: 2
 
 RE: copyfile to remote workstation trouble - 3/28/2006 9:00:24 AM   
  sirjadin26

 

Posts: 4
Score: 0
Joined: 3/20/2006
Status: offline
sorry that was something I was experimentingw ith and forgot to atke out when I discovered that it would quickly ebcome unwieldy as it gets used by multiple users.

Dim objFSO, objFolder
On Error Resume Next
set wshell = CreateObject("Wscript.Shell")
p1 = WScript.Arguments(0)
p2 = WScript.Arguments(1)
p3 = WScript.Arguments(2)
Const OverwriteExisting = TRUE
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "C:\pdf\"&p1 ,"\\"&p2&"\"&p3&"\", OverwriteExisting
WSCRIPT.QUIT

The error is triggered on teh line in bold

(in reply to ebgreen)
 
 
Post #: 3
 
 RE: copyfile to remote workstation trouble - 3/28/2006 9:09:15 AM   
  ebgreen


Posts: 5246
Score: 31
Joined: 7/12/2005
Status: offline
If I put in values for p1, p2, and p3 then it works fine for me so I would suggest doing a WScript.Echo just before the copy line to be sure that the copy parameters are really what you think they are.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to sirjadin26)
 
 
Post #: 4
 
 RE: copyfile to remote workstation trouble - 3/29/2006 12:15:18 AM   
  sirjadin26

 

Posts: 4
Score: 0
Joined: 3/20/2006
Status: offline
Like I sadi I have no problem getting teh script to work locally on the lan here at teh office, but when I try to run teh script to copy a file to a pc on the wan , ie at a different office, I get teh path not found error.

(in reply to ebgreen)
 
 
Post #: 5
 
 RE: copyfile to remote workstation trouble - 3/29/2006 12:35:03 AM   
  Cybex


Posts: 412
Score: 0
Joined: 9/14/2005
From: Florida
Status: offline
What is the exact path that you are using? Also can you explain a little better what you mean by WAN? Are you talking about from completely outside of your local network/domain across the internet to another network?  Or are you talking thru a VPN?


Cybex

< Message edited by Cybex -- 3/29/2006 12:43:57 AM >


_____________________________

Common sense is not so common.

(in reply to sirjadin26)
 
 
Post #: 6
 
 RE: copyfile to remote workstation trouble - 3/29/2006 1:05:34 AM   
  ebgreen


Posts: 5246
Score: 31
Joined: 7/12/2005
Status: offline
If you are going outside your local LAN, then I would say there is a high probablitity that your problem will be security related and not related to your script at all.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to Cybex)
 
 
Post #: 7
 
 RE: copyfile to remote workstation trouble - 3/29/2006 1:19:56 AM   
  sirjadin26

 

Posts: 4
Score: 0
Joined: 3/20/2006
Status: offline
You are likely right, I wa shoping it was something I was missing in the script but considering that it worked on the local LAN makes that tehory pretty far fetched, my next stop is to see if teh error is some how nailed down to the iseries calling the vbscript using RUNRMTCMD.   Does anybody know a forum where I might get thsi question answered?

(in reply to ebgreen)
 
 
Post #: 8
 
 RE: copyfile to remote workstation trouble - 3/29/2006 6:03:14 AM   
  mrgoodwin

 

Posts: 14
Score: 0
Joined: 3/29/2006
Status: offline
Your script cannot tell the difference between a WAN or a LAN.  At the OSI layer that your script operates on the WAN and LAN are all one big network.

There's a couple of caveats to that.  One is that there's conceivably something in the router that is preventing RPC calls (blocked port).  Can you run any WAN-wide scripts of this nature (not including login scripts as they may not run RPC calls)?  How is your network firewalled (firewalls often block this port)?  Windows firewall?

The other caveat is security credentials.  Are you admin over the systems on the WAN?  Different organizations handle that differently which is why I ask.

(in reply to sirjadin26)
 
 
Post #: 9
 
 
 
  

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 >> copyfile to remote workstation trouble 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