The MASM Forum

Projects => MasmBasic & the RichMasm IDE => Topic started by: jj2007 on February 09, 2024, 11:28:53 AM

Title: NetShareEnum alias net share
Post by: jj2007 on February 09, 2024, 11:28:53 AM
This is inspired by Fraile's thread on NetShareEnum (https://masm32.com/board/index.php?topic=11656.0):
  Dim MyShares$(tab)
  Let MyShares$(0)=cfm$("Name\tRemark\tPath")
  invoke MbShares, MyShares$(), 0    ; create a tab-delimited string array
  QSort MyShares$(), 1:99            ; sort alphabetically
  Store "MyShares.tab", MyShares$()
  ShEx "MyShares.tab"                ; ShellExecute the tab-delimited file

Under the hood is a 158 bytes proc (see attachment). At first sight, the output looks almost identical to what the net share produces from a DOS prompt; however, MbShares creates a tab-delimited string array for use with Excel (or any other spreadsheet program). ShEx (https://www.jj2007.eu/MasmBasicQuickReference.htm#Mb1375) will launch your default spreadsheet viewer/editor.