/bundles/itninjaweb/img/Breadcrumb_cap_w.png
Trying to get a fix out there.

I have a vbscript to unmap a few drives and a Wisescript to delete some files. I had both inserted in ExecuteImmediate, after InstallInitialize and only the wisescript was successfully executed. I moved vbscript CA to Execute deferred, before InstallFinalize, but got the same result.

When the vbscript and Wisescript were individually added to the MSI they worked properly, and obviously when I manually run each script they run properly.

What am I missing here?
0 Comments   [ - ] Hide Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
Answer this question or Comment on this question for clarity

Answers

0
I'd like to take a look at the VBScript
Answered 10/17/2005 by: urban_diver
Orange Senior Belt

Please log in to comment
0
Sloppy, but I was in a hurry and found this in my achive of "back-in-the-day-when-i-thought-i-could-code" codes.

Set oShell = WScript.CreateObject("WScript.Shell")
Set oNetwork = WScript.CreateObject("WScript.Network")

dr = "j:"
oNetwork.RemoveNetworkDrive dr, True, True
drv = "q:"
oNetwork.RemoveNetworkDrive drv, True, True
Answered 10/17/2005 by: Bladerun
Green Belt

Please log in to comment
0
Try this:


Option Explicit
Dim objNetwork, strDriveLetter
strDriveLetter = "J:"

Set objNetwork = CreateObject("WScript.Network")
' Section which removes strDriveLetter
objNetwork.RemoveNetworkDrive strDriveLetter
Wscript.Quit
Answered 10/17/2005 by: urban_diver
Orange Senior Belt

Please log in to comment
0
If I remember correctly, Wise doesn't like :
Set oShell = WScript.CreateObject ("WScript.Shell")

Remove WScript from CreateObject

Set oShell = CreateObject ("WScript.Shell")
Answered 10/17/2005 by: urban_diver
Orange Senior Belt

Please log in to comment
0
No dice.

I modified the vbscript as suggested, and it still didn't yank the network drives.


EDIT: actually I just modified it as mentioned in your second post. Let me try the first modification.

EDIT 2: yeah, didn't work either way. Could it be the CA placement in the sequence?
Answered 10/17/2005 by: Bladerun
Green Belt

Please log in to comment
0
If you run the vbscript manually, it executes successfully? How are you running the vbscript? Call VBScript from Embedded code? Call VBScript from Installation? Call VBScript from Installed Files?
Answered 10/17/2005 by: urban_diver
Orange Senior Belt

Please log in to comment
0
Yes, it runs properly when I double click the .vbs file.

I'm trying to add this script as a custom action and its not executing properly, so let's put it this way.

How should i be running this? It doesn't matter to me when it runs, as long as it runs.

(I'm using Wise.)
Answered 10/17/2005 by: Bladerun
Green Belt

Please log in to comment
1
Try this.

Set oShell = CreateObject("WScript.Shell")
Set oNetwork = CreateObject("WScript.Network")

dr = "j:"
oNetwork.RemoveNetworkDrive dr, True, True
drv = "q:"
oNetwork.RemoveNetworkDrive drv, True, True
Answered 10/17/2005 by: urban_diver
Orange Senior Belt

Please log in to comment
0
THANK YOU.

That worked. The vbscript and Wisescript both now work.



Reason number 3412352346232 why I need a better grasp of vbscript. Thanks again.
Answered 10/17/2005 by: Bladerun
Green Belt

Please log in to comment
0
sorry for being really anal about the coding but to be 100% correct.. (blablabla)

undeclare the objects aswell..

Set oNetwork = Nothing
Set oShell = Nothing

This should be "best-practice" always when coding to not muck up the system. Never trust the Windows Scripting Host.. [:D]

// martin
Answered 10/17/2005 by: mgroover
Senior Yellow Belt

Please log in to comment