Video Screencast Help
Search Video Help Close Back
to help
New in the Rewards Catalog: Vouchers for "Symantec Technical Specialist" and "Symantec Certified Specialist" exams.

Wise Script to Map a Network Folder

Updated: 19 Dec 2008 | 4 comments
Eshwar's picture
+25 25 Votes
Login to vote

If you are planning to map a network folder as a drive using Wise script, attached is the Wise script that can do the task for you.

You have to define two variables in this sample script.

  1. Network folder full path

    SHARE_FOLDER [\\SERVER_NAME\SHARE_NAME]

  2. Drive letter

    DRIVE_LETTER[W:]

License: AJSL
By clicking the download link below, you agree to the terms and conditions in the Altiris Juice Software License
Support: User-contributed tools on the Juice are not supported by Altiris Technical Support. If you have questions about a tool, please communicate directly with the author by visiting their profile page and clicking the 'contact' tab.

Comments

Sidd's picture
21
Dec
2008
11 Votes +11
Login to vote

VBScript to Map a Network Folder

Dim objNetwork, strDrive, objShell
Dim strRemotePath, strDriveLetter, strNewName

strDriveLetter = "F:"
strRemotePath = "\\MyServer\Myfolder"

' Section to map the network drive
Set objNetwork = CreateObject("WScript.Network")
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath

wuzfuzzy's picture
22
Dec
2008
0 Votes 0
Login to vote

Batch Script to map drive

net use w: \\Server\Share

Lee Wilburn
Suzlon Wind Energy
If your question has been resolved, please click "Mark as Solution"! Thank you. Hope it helps!

sdelance's picture
18
Aug
2010
0 Votes 0
Login to vote

Wise script for mapping the %INST% directory

We often find it useful to map the %INST% directory (either a network drive or another folder) as the first available drive letter to reduce the character count in a command line. Here's the code to copy and paste into a blank WiseScript .WSE :
item: Remark
  Text=***   Map the installation source as the first free drive letter
end
item: Set Variable
  Variable=SP_INST
  Value=%INST%
  Flags=00010100
end
item: Set Variable
  Variable=DRIVELETTERS
  Value=GHIJKLMNOPQRSTUVWXYZ
end
item: Set Variable
  Variable=ICOUNTER
  Value=1
end
item: Set Variable
  Variable=IMAX
  Value=20
end
item: Set Variable
  Variable=DRIVE_LTR
  Value=NOTHING
end
item: If/While Statement
  Value=ICounter <= IMAX
  Flags=00011101
end
item: Set Variable
  Variable=CDRIVE
  Value=Mid$(DRIVELETTERS,iCounter,1)
  Flags=00100000
end
item: Get System Information
  Variable=DRIVETYPE
  Pathname=%CDRIVE%
  Flags=00001000
end
item: If/While Statement
  Variable=DRIVETYPE
end
item: Set Variable
  Variable=DRIVE_LTR
  Value=%CDRIVE%
end
item: Set Variable
  Variable=ICOUNTER
  Value=100
end
item: End Block
end
item: Set Variable
  Variable=ICOUNTER
  Value=%ICOUNTER%
  Flags=00000100
end
item: End Block
end
item: Remark
end
item: If/While Statement
  Variable=OS
  Value=2000
end
item: If/While Statement
  Variable=SP_INST
  Value=\\
  Flags=00000010
end
item: Execute Program
  Pathname=%SYS32%\cmd.exe
  Command Line=/c "net use %DRIVE_LTR%: %SP_INST%"
  Flags=00001010
end
item: Else Statement
end
item: Execute Program
  Pathname=subst.exe
  Command Line=%DRIVE_LTR%: %SP_INST%
  Flags=00001010
end
item: End Block
end
item: Else Statement
end
item: Parse String
  Source=%SP_INST%
  Pattern=1
  Variable1=CHECKVAL
  Variable2=JUNK
  Flags=00001100
end
item: If/While Statement
  Variable=CHECKVAL
  Value=:
  Flags=00000100
end
item: Execute Program
  Pathname=subst.exe
  Command Line=%DRIVE_LTR%: %SP_INST%\
  Flags=00001010
end
item: Else Statement
end
item: Execute Program
  Pathname=subst.exe
  Command Line=%DRIVE_LTR%: %SP_INST%
  Flags=00001010
end
item: Custom Script Item
  Filename=- NG Execute Program.wse
  Variable Name1=_NGEXE_EXE_
  Variable Value1=subst.exe
  Variable Name2=_NGEXE_WINDSIZE_
  Variable Value2=Hidden
  Variable Name3=_NGEXE_COMMENT_
  Variable Value3=Mapping installation directory as %DRIVE_LTR%:\ drive
  Variable Name4=_NGEXE_WAIT_
  Variable Value4=A
  Variable Name5=_NGEXE_CMDLINE_
  Variable Value5=%DRIVE_LTR%: %SP_INST%
  Variable Name6=_NGEXE_DEFDIR_
end
item: End Block
end
item: End Block
end

WiseUser's picture
07
Sep
2010
0 Votes 0
Login to vote

Yeah good one but it is not

Yeah good one but it is not advisable to map a network drive in the msi ..

Wiseuser
Altiris Certified Professional