/build/static/layout/Breadcrumb_cap_w.png

VBScript 1720 Error?

I tested the VBScript outside of the MSI and it worked perfectly fine. When I try to execute the Custom Action of calling it from the installation it fails and throws me the 1720 Error. The code is as follows:


DIM fso, NewsFile
Const RDP = "test.rdp"

username = InputBox("Please enter the your Echo Account Username:","Echo Account Username")

systemname = InputBox("Please enter your computer name:","Computer Name")

Set fso = CreateObject("Scripting.FileSystemObject")
Set NewsFile = fso.OpenTextFile(RDP, 8)
NewsFile.WriteLine("username:s:"& username)
NewsFile.WriteLine("domain:s:domain")
NewsFile.WriteLine("full address:s:"& systemname &".domain.com")
NewsFile.Close


The script seems to fail around the "Set fso" line. I get the two input dialog boxes before it fails. Any idea of why this is happening?

0 Comments   [ + ] Show comments

Answers (7)

Posted by: MSIPackager 18 years ago
3rd Degree Black Belt
2
Use message boxes (msgbox) to find out exactly where the script is failing..

You haven't defined a path to the test.rdp file you are opening either.. are you sure your script can find it?

Also, where have you sequenced the CA - execute immediate / deferred etc?

Cheers,
Rob.
Posted by: rpfenninger 18 years ago
Second Degree Green Belt
0
I'm not very keen at creating complicated scripts.
The only thing I know is that it's important to include the following when you try to execute a VB Script from inside a MSI:


CreateObject("Wscript.Shell")


I don't know if this is the problem in your case.

Hope it helps

Roland
Posted by: cessna 18 years ago
Senior Yellow Belt
0
ORIGINAL: MSIPackager

Use message boxes (msgbox) to find out exactly where the script is failing..

You haven't defined a path to the test.rdp file you are opening either.. are you sure your script can find it?

Also, where have you sequenced the CA - execute immediate / deferred etc?

Cheers,
Rob.


Thanks! I had to give it the fully qualified path to the file. The MSI installs the vbscript on the hdd next to the "test.rdp" file. I had assumed incorrectly that it would find the file. When I tested the vbscript outside of the MSI it had worked perfectly fine.
Posted by: MSIPackager 18 years ago
3rd Degree Black Belt
0
No probs, glad to have helped...

rpfenninger makes a good point too - definately worth bearing in mind when using embedded VBScript as a CA:

Never:
Set wshell = WScript.CreateObject("WScript.Shell")

Always:
Set wshell = CreateObject("WScript.Shell")

Explanation of why is here (2nd note at the bottom)

That one catches everyone out sooner or later [:@]

Regards,
Rob.
Posted by: cessna 18 years ago
Senior Yellow Belt
0
Hehe, yup. I originally had that problem and tracked that one down. [:@]
Posted by: noodles187 17 years ago
Orange Belt
0
that one
Hello my learned packagers, i added a vb script to my CA for a package and i get error 1720 while trying to run as "user", but it installs fine as admin.
Below is my script

set fs = CreateObject("Scripting.FileSystemObject")
set file = fs.opentextfile("c:\windows\system32\drivers\etc\services.", 8)
file.writeline "K293live 2501/tcp #Figtree live DB"
file.close

Can anyone please detect if anything is the problem here

Thanks
Posted by: brenthunter2005 17 years ago
Fifth Degree Brown Belt
0
Thats because "users" don't have the neccessary NTFS permissions to edit this file.

You need to run the custom action in the "Deferred Execution - System Context" and place the action before the InstallFinalize actions. Remember to condition the custom action so that it only runs on installation etc.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ