Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

VBScript and creating a folder share


1 reply to this topic

sayseal75

sayseal75
  • Members
  • 4 posts

Posted 23 August 2001 - 13:58

I am using the following script to try to create a share on the local machine.  What am I doing wrong?

Dim Fso
Dim WshShell

Set Fso = CreateObject("Scripting.FileSystemObject")
Set WshShell = Wscript.CreateObject("Wscript.Shell")

cmdline = "net share " & "ShareNameHere" & "=" & "FolderNameHere"
Return = WshShell.Run(cmdline, 0, TRUE)

I keep getting the VBScript compile error (2740).  When I run this code outside of WI, it works.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 23 August 2001 - 22:14

Your script is not running in WSH but in the installer. So there's no Wscript object. Change to:
Set WshShell = CreateObject("Wscript.Shell")