Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Share a Remote Computer Folder

Status
Not open for further replies.

comnetlimited

Technical User
Oct 7, 2003
68
0
0
PG
Hi Friends
A typical site of ours have a Server and around 10 computers. They are all connected to the server. We have 20 Sites. There is a particular file that I want to copy from the server's "c:\jetform\templates\file01.xxx" to "c:\jetform\templates\" folder of the other computers that are on the network.

The problem is the "jetform" folder is not shared on all these computers (including the server).

Now I tested copying the file to a shared folder but I tried with an unshared folder and it could not.

Can the scenerio described above be achieved by VBScript??

Would really appreciate your timely response.



 
Tell me if I am wrong.

You cannot create a shared folder on a remote computer if none of his folders are shared.

For example RemoteComputer have Three Folders in its C: Drive i.e. Folder1, Folder2 and Folder3. Folder1 is shared as Folder1 and has three SubFolders i.e. subFolder1, and SubFolder2.

You are on ServerOne with Admin Rights and can see RemoteComputer.

Theory 1: It is impossible to Share a Folder2 in RemoteComputer if you are running your VBScript on Server1

Theory 2: You can share subFolder1 if you are running your VBScript on Server1.

 
[1]>You cannot create a shared folder on a remote computer if none of his folders are shared.
Not really. There would be "hidden" admin share at the root unless taken out every time after the m/c boot up. Even, none of his folders are shared, you can create one as admin.

[2]>Theory 1: It is impossible to Share a Folder2 in RemoteComputer if you are running your VBScript on Server1
The answer is no. You can and that's the question you ask.

[3]>Theory 2: You can share subFolder1 if you are running your VBScript on Server1.
If the answer to theory 1 is no, theory 2 is even more so yes. Even more so means even if Folder1 is not shared you can share out subFolder1.

This is the minimal script to create a share. Run it on server1 and create share on server2
[tt]
dim sserver2,svc,iret
sserver2="a0b1c2"
set svc=getobject("winmgmts:\\" & sserver2 & "\root\cimv2")
iret=svc.get("win32_share").create("c:\jetform","jf_sharename",0,10)
set svc=nothing
[/tt]
This will create a share on c:\jetform (which must exist before running it, otherwise it won't be created for you) on server2 with sharename jf_sharename, an ordinary disk drive (parameter 0) share with a restriction of 10 simultaneous connection (parameter 10). You can thereby access the file by with \\a0b1c2\jf_sharename\templates\file01.xxx with the server2 name properly replaced.

You cannot do such kind of thing without consulting the documentation.

And you'll find a fairly comprehensive samples and technical detail etc in msdn. Something down to earth.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top