
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-31-2014 03:29 AM
I have shares occasionally created by software that I would like to manage and remove using a software deployment. I have the deployment process running right and have used it to update lansweeper itself now with success. Admittedly, I'm having trouble wrapping my brain around the syntax of the script. Can anyone give me a basic example of how to add and remove shares?
thank you in advance,
Dave
thank you in advance,
Dave
Solved! Go to Solution.
Labels:
- Labels:
-
General Discussion
1 ACCEPTED SOLUTION

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-01-2015 03:29 PM
It seems i totally misinterpreted your intension there.
What i would do is, create a package with a 'Command' step.
Paste the command I would normally use in a command prompt in this step.
(ex. net share YOUR_SHARE_NAME /delete)
After that, deploy the package to a selection of assets.
Our 'Command' step is basically a command that is executed in the command prompt on the targeted asset.
Happy New Year
What i would do is, create a package with a 'Command' step.
Paste the command I would normally use in a command prompt in this step.
(ex. net share YOUR_SHARE_NAME /delete)
After that, deploy the package to a selection of assets.
Our 'Command' step is basically a command that is executed in the command prompt on the targeted asset.
Happy New Year

5 REPLIES 5

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2019 09:55 PM
Old thread, but subject is pretty much what we are doing..
Any idea why using deplay, with COMMAND step, and the command
net use z: /delete
doesnt appear to be working?
The command works if we manually go to the computer and run it in a prompt, the deploy flashes a command box for a second as its firing, we arent seeing anything taking affect.
Last time we used deploy its was prior to the update to v. 7.0.110.2... Was wondering if there is something we need to change in our config to keep the deploy working?
Thanks
Any idea why using deplay, with COMMAND step, and the command
net use z: /delete
doesnt appear to be working?
The command works if we manually go to the computer and run it in a prompt, the deploy flashes a command box for a second as its firing, we arent seeing anything taking affect.
Last time we used deploy its was prior to the update to v. 7.0.110.2... Was wondering if there is something we need to change in our config to keep the deploy working?
Thanks

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-01-2015 11:20 PM
Straightforward and simple. Thank you very much.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-01-2015 03:29 PM
It seems i totally misinterpreted your intension there.
What i would do is, create a package with a 'Command' step.
Paste the command I would normally use in a command prompt in this step.
(ex. net share YOUR_SHARE_NAME /delete)
After that, deploy the package to a selection of assets.
Our 'Command' step is basically a command that is executed in the command prompt on the targeted asset.
Happy New Year
What i would do is, create a package with a 'Command' step.
Paste the command I would normally use in a command prompt in this step.
(ex. net share YOUR_SHARE_NAME /delete)
After that, deploy the package to a selection of assets.
Our 'Command' step is basically a command that is executed in the command prompt on the targeted asset.
Happy New Year


Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-01-2015 06:04 AM
Thanks so much for the reply. This is great, but not quite what I was looking for.
I'll use the lansweeper installer as an example:
It creates a lansweeper$ share and a defaultpackageshare$ upon install. On 30 or so servers that only have the scanning component of Lansweeper, these shares are not necessary.
I would like to create a package and deploy it to remove these shares from those systems rather than manually do it.
In a normal command prompt, I can simply issue the "net share lansweeper$ /delete" command to remove the share.
thank you again,
Dave
I'll use the lansweeper installer as an example:
It creates a lansweeper$ share and a defaultpackageshare$ upon install. On 30 or so servers that only have the scanning component of Lansweeper, these shares are not necessary.
I would like to create a package and deploy it to remove these shares from those systems rather than manually do it.
In a normal command prompt, I can simply issue the "net share lansweeper$ /delete" command to remove the share.
thank you again,
Dave

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-31-2014 10:42 AM
Simple vbs script to first map a drive and then unmap it again
Slightly more advanced vbs script mapping a drive without a drive letter and then unmapping it again if exists
Hope this helps you on your way
Dim objNetwork
Set objNetwork = CreateObject("WScript.Network")
objNetwork.MapNetworkDrive "I:", "PATH_OF_SHARE","True","jdoe","jdoepassword"
objNetwork.RemoveNetworkDrive "I:"
Slightly more advanced vbs script mapping a drive without a drive letter and then unmapping it again if exists
Dim objNetwork
Set objNetwork = CreateObject("WScript.Network")
objNetwork.MapNetworkDrive "", "PATH_OF_SHARE","True","jdoe","jdoepassword"
Set objDrives = objNetwork.EnumNetworkDrives
If objDrives.Count > 0 Then
For i = 0 To objDrives.Count-1 Step 2
If objDrives.Item(i+1) = "PATH_OF_SHARE" Then
objNetwork.RemoveNetworkDrive "PATH_OF_SHARE", True, True
i=objDrives.Count-1
End If
Next
End If
Hope this helps you on your way
