|
From: "Eric van Uden" <ericvanuden THISGOES @ OUT on 16 Feb 2005 18:08 I have a limited experience with vbs scripting, so I would be grateful for some help. I need to script copying a file from one pc to another. The source part is no problem, as I can access a share on the source pc directly. Due to network configuration issues I need to set a connection/access the target WinXP Pro pc by its IP address (say 192.168.200.1) and logon with username and password (say "pcname\myname" and "mypass"). Is there a way to make this work in one go: logon remotely (maybe map the remote share to local drive letter temporarily) copy the file tothe remote share (maybe mop up) Thanks in advance, Eric
From: "Michael Harris (MVP)" <mikhar at mvps dot on 16 Feb 2005 19:01 > logon remotely > (maybe map the remote share to local drive letter temporarily) > copy the file tothe remote share > (maybe mop up) In the WshShell.MapNetworkDrive call, you can use \\ipaddress\sharename in place of \\servername\sharename. It also supports usrname and password arguments. So a looped solution that calls MapNetworkDrive with an ipaddress based UNC path plus passing credentials, FSO calls using the mapped drive letter, and a call to RemoveNetworkDrive seems to solve your problem. -- Michael Harris Microsoft MVP Scripting http://maps.google.com/maps?q=Sammamish%20WA%20US
From: "Eric van Uden" <eric[ @ ]doornroosje[ . on 17 Feb 2005 03:48 Hello Michael, Thanks for pointing the way. I'm exploring your suggestion at the moment. No luck so far, but the MapNetworkDrive call makes sense. It may be that network confihuration forbids, though. The target pc is in the DMZ and does not log on to our network server. I am trying to get to it not as [domain\user password] but as [pcname\user password]. This would mean a local account on that XP box and not an authenticated domain account from our (NT) network. If I type its IP address in the Run dialog and hit Enter, I am presented with a logon dialog, where I can supply user [ pcname\user] and password. After that, I am free to access all shares on that box through Explorer or batch or otherwise. This is what I am trying to emulate with my intended script. I'm missing something obvious and I'm aware that it is because of my ignorance in this matter. Additional tips would be appreciated. Eric "Michael Harris (MVP)" <mikhar at mvps dot org> schreef in bericht news:e6TaXPIFFHA.1188(a)tk2msftngp13.phx.gbl... >> logon remotely >> (maybe map the remote share to local drive letter temporarily) >> copy the file tothe remote share >> (maybe mop up) > > > > In the WshShell.MapNetworkDrive call, you can use \\ipaddress\sharename > in place of \\servername\sharename. It also supports usrname and password > arguments. > > So a looped solution that calls MapNetworkDrive with an ipaddress based > UNC path plus passing credentials, FSO calls using the mapped drive > letter, and a call to RemoveNetworkDrive seems to solve your problem. > > > > -- > Michael Harris > Microsoft MVP Scripting > http://maps.google.com/maps?q=Sammamish%20WA%20US >
From: "Michael Harris (MVP)" <mikhar at mvps dot on 17 Feb 2005 20:35 Eric van Uden wrote: > Hello Michael, > > Thanks for pointing the way. I'm exploring your suggestion at the > moment. No luck so far, but the MapNetworkDrive call makes sense. > It may be that network confihuration forbids, though. The target pc > is in the DMZ and does not log on to our network server. > I am trying to get to it not as [domain\user password] but as > [pcname\user password]. This would mean a local account on that XP > box and not an authenticated domain account from our (NT) network. The username in the MapNetworkDrive call can be in "pcname\username" form. I don't have a DMZ box that I can test against, but AFAIK it should work. You could try to authenticate to the IPC$ share first. If it succeeds then you *should* be able to use \\ipaddress\sharename syntax directly in fso method calls without mapping a drive letter. You can use shell.run to execute a "net use \\ipaddress\sharename password /user:pcname\username" command with credentials or MapNetworkDrive with an empty string as the drive letter. I've done both successfully, just not by ipaddress of a box in the DMZ... Google Search http://groups-beta.google.com/groups?q=mapnetworkdrive%20ipc$%20group:*.scripting%20author:%22Michael%20Harris%22 > > If I type its IP address in the Run dialog and hit Enter, I am > presented with a logon dialog, where I can supply user [ pcname\user] > and password. After that, I am free to access all shares on that box > through Explorer or batch or otherwise. > This is what I am trying to emulate with my intended script. > > I'm missing something obvious and I'm aware that it is because of my > ignorance in this matter. > > Additional tips would be appreciated. > > Eric > > "Michael Harris (MVP)" <mikhar at mvps dot org> schreef in bericht > news:e6TaXPIFFHA.1188(a)tk2msftngp13.phx.gbl... >>> logon remotely >>> (maybe map the remote share to local drive letter temporarily) >>> copy the file tothe remote share >>> (maybe mop up) >> >> >> >> In the WshShell.MapNetworkDrive call, you can use >> \\ipaddress\sharename in place of \\servername\sharename. It also >> supports usrname and password arguments. >> >> So a looped solution that calls MapNetworkDrive with an ipaddress >> based UNC path plus passing credentials, FSO calls using the mapped >> drive letter, and a call to RemoveNetworkDrive seems to solve your >> problem. -- >> Michael Harris >> Microsoft MVP Scripting >> http://maps.google.com/maps?q=Sammamish%20WA%20US -- Michael Harris Microsoft MVP Scripting http://maps.google.com/maps?q=Sammamish%20WA%20US
From: "Eric van Uden" <ericvanuden THISGOES @ OUT on 17 Feb 2005 21:08 Thanks a lot for the follow up, Michael! You have given me plenty of ways to go and I'm sure your pointers will pay out for me. Adding a network drive mapping to my logon script would suit me very well, so I will start with the 'net use' suggestion. I'm giving it another try tomorrow! I'll be sure to post back with the results. Eric "Michael Harris (MVP)" <mikhar at mvps dot org> schreef in bericht news:eUDrUoVFFHA.3908(a)TK2MSFTNGP12.phx.gbl... | Eric van Uden wrote: | > Hello Michael, | > | > Thanks for pointing the way. I'm exploring your suggestion at the | > moment. No luck so far, but the MapNetworkDrive call makes sense. | > It may be that network confihuration forbids, though. The target pc | > is in the DMZ and does not log on to our network server. | > I am trying to get to it not as [domain\user password] but as | > [pcname\user password]. This would mean a local account on that XP | > box and not an authenticated domain account from our (NT) network. | | | The username in the MapNetworkDrive call can be in "pcname\username" form. I | don't have a DMZ box that I can test against, but AFAIK it should work. | | You could try to authenticate to the IPC$ share first. If it succeeds then | you *should* be able to use \\ipaddress\sharename syntax directly in fso | method calls without mapping a drive letter. | | You can use shell.run to execute a | | "net use \\ipaddress\sharename password /user:pcname\username" | | command with credentials or MapNetworkDrive with an empty string as the | drive letter. | | I've done both successfully, just not by ipaddress of a box in the DMZ... | | Google Search | http://groups-beta.google.com/groups?q=mapnetworkdrive%20ipc$%20group:*.scripting%20author:%22Michael%20Harris%22 | | | > | > If I type its IP address in the Run dialog and hit Enter, I am | > presented with a logon dialog, where I can supply user [ pcname\user] | > and password. After that, I am free to access all shares on that box | > through Explorer or batch or otherwise. | > This is what I am trying to emulate with my intended script. | > | > I'm missing something obvious and I'm aware that it is because of my | > ignorance in this matter. | > | > Additional tips would be appreciated. | > | > Eric | > | > "Michael Harris (MVP)" <mikhar at mvps dot org> schreef in bericht | > news:e6TaXPIFFHA.1188(a)tk2msftngp13.phx.gbl... | >>> logon remotely | >>> (maybe map the remote share to local drive letter temporarily) | >>> copy the file tothe remote share | >>> (maybe mop up) | >> | >> | >> | >> In the WshShell.MapNetworkDrive call, you can use | >> \\ipaddress\sharename in place of \\servername\sharename. It also | >> supports usrname and password arguments. | >> | >> So a looped solution that calls MapNetworkDrive with an ipaddress | >> based UNC path plus passing credentials, FSO calls using the mapped | >> drive letter, and a call to RemoveNetworkDrive seems to solve your | >> problem. -- | >> Michael Harris | >> Microsoft MVP Scripting | >> http://maps.google.com/maps?q=Sammamish%20WA%20US | | -- | Michael Harris | Microsoft MVP Scripting | http://maps.google.com/maps?q=Sammamish%20WA%20US | |
|
Pages: 1 Prev: Wait for the install to finsh! Please! Next: window.opener problem! |