Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


copy files from network drive to local computer without mapping

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> copy files from network drive to local computer without mapping
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1] 2   next >   >>
Login
Message << Older Topic   Newer Topic >>
 copy files from network drive to local computer without... - 12/17/2007 4:10:11 AM   
  rsharma

 

Posts: 2
Score: 0
Joined: 12/17/2007
Status: offline
Is there a way to copy files from a shared network drive to local folder without mapping the drive. I need to pass network credentials username and password, but i dont want the drive mapped for the user. Here is the code i keep running into but i'm not sure how to modify it to my needs:

      

Temporailly mapping the drive and copying the files is not an option. Any help would be greatly appreciated.
 
 
Post #: 1
 
 RE: copy files from network drive to local computer wit... - 12/17/2007 7:00:13 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
Well for one thing, this:

strProfile = "False"

Should be this:

strProfile = False

_____________________________

"... 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 rsharma)
 
 
Post #: 2
 
 RE: copy files from network drive to local computer wit... - 12/17/2007 7:11:50 AM   
  rsharma

 

Posts: 2
Score: 0
Joined: 12/17/2007
Status: offline
Ok.. I had only demo'd this and it does map the drive properly.. but it still does not address my problem, in that I would like to directrly copy after passing login paramters without mapping the drive.

(in reply to ebgreen)
 
 
Post #: 3
 
 RE: copy files from network drive to local computer wit... - 12/17/2007 7:16:02 AM   
  mbouchard


Posts: 1861
Score: 14
Joined: 5/15/2003
From: USA
Status: offline
Use net use instead of mapnetworkdrive.

WshShell.Run "cmd /c net use \\servername\share /USER:domain\username password",1,True

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to rsharma)
 
 
Post #: 4
 
 RE: copy files from network drive to local computer wit... - 12/17/2007 7:22:41 AM   
  DiGiTAL.SkReAM


Posts: 1157
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
Yes, you can map to a share without using a drive letter.
You just have to setup the copy command to use a UNC path.
Then, remove the mapping.

This, of course, assumes that you cannot use pass-thru authentication.  If you can, then don't use the map/unmap commands.  just do a straight file copy to a UNC path.


      


      


_____________________________

"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 rsharma)
 
 
Post #: 5
 
 RE: copy files from network drive to local computer wit... - 3/11/2008 4:57:19 AM   
  dslider

 

Posts: 49
Score: 0
Joined: 1/23/2008
Status: offline
What if you want to copy a file from a remote computer that has no shares? We cant map the drive.... for security purposes

We are running the script on a local machine and trying to copy a file from a remote machine.....
We just want to login into the computer remotely, copy a file to a local folder...then disconnect.... without having to share the drive or mapping it

(in reply to rsharma)
 
 
Post #: 6
 
 RE: copy files from network drive to local computer wit... - 3/11/2008 5:02:15 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
So you want to do what is expplicitly forbidden by security policy? Does that seem wise?

_____________________________

"... 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 dslider)
 
 
Post #: 7
 
 RE: copy files from network drive to local computer wit... - 3/11/2008 5:13:49 AM   
  dslider

 

Posts: 49
Score: 0
Joined: 1/23/2008
Status: offline
What I need to do is install a certificate on the client computer from the server... then it needs to be imported... I have the code to import it once it is on the local computer..... so unless there is another way I can get the cert from the server itself.. I think this may be the only way? correct me if I am wrong

(in reply to ebgreen)
 
 
Post #: 8
 
 RE: copy files from network drive to local computer wit... - 3/11/2008 5:16:56 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
Do you have SMS in your environment?

_____________________________

"... 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 dslider)
 
 
Post #: 9
 
 RE: copy files from network drive to local computer wit... - 3/11/2008 5:19:49 AM   
  dslider

 

Posts: 49
Score: 0
Joined: 1/23/2008
Status: offline
Are you refering to Microsofts Systems Management Server (SMS)? 
No we dont

(in reply to ebgreen)
 
 
Post #: 10
 
 RE: copy files from network drive to local computer wit... - 3/11/2008 5:23:03 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
Ok, so how about writing a script that runs on the server and is run under an account with admin rights on all the clients? The script could push the file to the client machines and have it there waiting for your registration script.

_____________________________

"... 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 dslider)
 
 
Post #: 11
 
 RE: copy files from network drive to local computer wit... - 3/11/2008 5:42:47 AM   
  dslider

 

Posts: 49
Score: 0
Joined: 1/23/2008
Status: offline
I am pretty new at creating scripts and all and I am having a hard time following what you mean.... can you explain a little bit further.....

How can I push the file to the client?  we cant share or map the drives on the client either...

Is there a way to login through terminal services and copy the file?

(in reply to ebgreen)
 
 
Post #: 12
 
 RE: copy files from network drive to local computer wit... - 3/11/2008 5:51:23 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
Wow. You really need to have a sitdown with your network admins. So in your environment, your network admins have decided it is safer to make you take total control of machines than it is to expose a share with controlled permissions? That's just nuts. I do not know of any way to script Terminal Services in that fashion. That doesn't mean that it doesn't exist though.

Really, I can't get over this. It would be much more secure for them to open a share on the server to a folder that holds nothing but that one file and give everyone read only access to it. I am definitely not a network security expert, so I would love to hear from your network admins why it is preferable to have a script take total control of the server (or client) rather than opening a read only share.

_____________________________

"... 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 dslider)
 
 
Post #: 13
 
 RE: copy files from network drive to local computer wit... - 3/11/2008 6:03:54 AM   
  dslider

 

Posts: 49
Score: 0
Joined: 1/23/2008
Status: offline
Basically we have an app that allows us to configure applications that we choose to for each client... they can be different for each client..... this application then calls a config script for that specific app.... I am trying to write one for an web app that needs a certificate from a server so it can interact with it..... we dont want the user to have to import the certificate themself... the less they have to do the better....

In our environment we have very tight security and we are not allowed to share a drive........ company policy

I know that a while back I was working with Symantec Endpoint and it deploys/pushes a cleint to all clients from a server and I was able to get this to work... I think I had to eneter the username and password.... so there has to be a way to login and pull the cert from the server.... or at least push it to a client

(in reply to ebgreen)
 
 
Post #: 14
 
 RE: copy files from network drive to local computer wit... - 3/11/2008 6:11:36 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
"In our environment we have very tight security and we are not allowed to share a drive........ company policy"

And yet instead your policy is encouraging you to use Terminal Services which has total control of the machine and could wreak much more havoc than an open share could. And to be clear, I'm not advocating sharing a drive. I'm talking about sharing one highly controlled folder.

_____________________________

"... 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 dslider)
 
 
Post #: 15
 
 RE: copy files from network drive to local computer wit... - 3/11/2008 6:15:40 AM   
  dslider

 

Posts: 49
Score: 0
Joined: 1/23/2008
Status: offline
I understand.. and we actually have terminal services disabled...... I am just trying to think of a way to grab the file without having to share a folder...  any suggestion?

(in reply to ebgreen)
 
 
Post #: 16
 
 RE: copy files from network drive to local computer wit... - 3/11/2008 6:21:43 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
Nope. The security policy that you have is there explicitly to stop exactly what you are trying to do. I am not familiar with how Symantec Endpoint works so I don't know how it did it.

_____________________________

"... 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 dslider)
 
 
Post #: 17
 
 RE: copy files from network drive to local computer wit... - 3/12/2008 12:33:03 AM   
  DiGiTAL.SkReAM


Posts: 1157
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
So did your network admins delete the admin shares?
\\workstation\c$
is the path to the default admin share pointof the c-drive.  As long as you have administrative access to the box, you should be able to connect to that sharepoint.
Unless the network admins have specifically disabled ALL shares on the workstations, in which case, Symantec Endpoint (which is one of hte buggiest pieces of sludge to ever ooze out of Symantec's orifice) would not have been able to perform a 'push-install'.


_____________________________

"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 ebgreen)
 
 
Post #: 18
 
 RE: copy files from network drive to local computer wit... - 3/12/2008 12:58:46 AM   
  dslider

 

Posts: 49
Score: 0
Joined: 1/23/2008
Status: offline
we have no shares on the computers.. but I was able to perform the push to a client?

is there a way I can make a http request to the server and pull the cert that way?

(in reply to DiGiTAL.SkReAM)
 
 
Post #: 19
 
 RE: copy files from network drive to local computer wit... - 3/12/2008 1:03:34 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
Is the server running IIS or Apache?

_____________________________

"... 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 dslider)
 
 
Post #: 20
 
 
Page:   [1] 2   next >   >>
 
  

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 >> copy files from network drive to local computer without mapping Page: [1] 2   next >   >>
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