0% found this document useful (0 votes)
631 views

Comp 230 W3 Net Share Server Code

This VBScript creates a shared network folder called "PublicData" on the computer "vlab-PC1". It copies files from the Windows Cursors folder to the new "C:\Public" folder, then creates a network share called "PublicData" pointing to that folder. It lists the current and new shares, then sleeps for 10 minutes before deleting the share and folder.

Uploaded by

Diayeah
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
631 views

Comp 230 W3 Net Share Server Code

This VBScript creates a shared network folder called "PublicData" on the computer "vlab-PC1". It copies files from the Windows Cursors folder to the new "C:\Public" folder, then creates a network share called "PublicData" pointing to that folder. It lists the current and new shares, then sleeps for 10 minutes before deleting the share and folder.

Uploaded by

Diayeah
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

' VBScript: NetShareServer.

vbs ' Written by: ' Date: ' Class: ' Professor: ' ================================= Set fso = CreateObject("Scripting.FileSystemObject") Set fileServ = GetObject("WinNT://vlab-PC1/LanmanServer,FileService") On Error Resume Next fso.CreateFolder("C:\Public") fso.CopyFile "C:\Windows\Cursors\w*.*","C:\Public" WScript.Echo vbCrLf & "Current Network Shares" For Each sh In fileServ WScript.Echo sh.name Next Set share = fileServ.Create("FileSHare", "PublicData") share.Path = "C:\Public" share.MaxUserCount = 10 share.SetInfo WScript.Echo vbCrLf WScript.Echo "New Network Shares" For Each sh In fileServ WScript.Echo sh.name Next WScript.Echo vbCrLf & "\\vlab-PC1\PublicData Share will be Available for 60 Seco nds!!" WScript.Sleep(600000) fileServ.Delete "FileShare","PublicData" fso.DeleteFolder "C:\Public",True WScript.Echo vbCrLf & "End of Program"

You might also like