Home > Software engineering >  VBS script will teachers machine VBS homework. Doc files copied to the unit
VBS script will teachers machine VBS homework. Doc files copied to the unit

Time:09-24

VBS script will teachers machine VBS homework. Doc files copied to the unit

CodePudding user response:

Fyi:
 ServerShare="\ \ 192.168.3.56 \ d $" 
The UserName="somedomain \ someuser"
Password="somepassword"

The Set NetworkObject=CreateObject (" work "WScript.Net

NetworkObject. MapNetworkDrive ", "ServerShare, False, UserName, Password,"

The Set of FSO=CreateObject (" Scripting. FileSystemObject ")
Set the Directory=FSO. GetFolder (ServerShare)
For Each FileName In the Directory. The Files
WScript. Echo FileName. The Name
Next
Set the FileName=Nothing
Set the Directory=Nothing
The Set of FSO=Nothing

NetworkObject. RemoveNetworkDrive ServerShare, True, False

The Set NetworkObject=Nothing

CodePudding user response:

Disk drive mapping, map the folder for Z:, local operating directly,
  • Related