Writing to a file in acustom action vbscript - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

gjandris
Posts: 15
Joined: Tue Jan 12, 2010 8:51 pm

Writing to a file in acustom action vbscript

I am trying to write to a file that I install with a vbscript custom action.
I followed the How do I write text into a file? entry in the help.

When I set the path to the file in the vbscript manually, ie:
snapintxt = "C:\Program Files (x86)\Telcordia\Granite Inventory\Inventory Admin Client\snapinlist.txt"

All is well and everything runs.

When I take the value passed in through CustomActionData , I get the error:
Custom action makeSnapInList.vbs script error -2146828236, Microsoft VBScript runtime error: Bad file name or number Line 23, Column 1

This is driving me nuts, I print out the 2 values side by side and they are identical, there must be extra characters on
the passed in string, Trim doesn't fix it. Is there any other way? Any help would be appreciated.
Thanks!
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Writing to a file in acustom action vbscript

Hello,

This type of error usually occurs when you try to open or create a file with a named constant(e.g. ForAppending),when instead you should have used a constant.
These are the possible values:
  • ForReading 1
  • ForWriting 2
  • ForAppending 8
Please review your code and If the problem persists please send us the .AIP (project) and a verbose log of the installation to support at advancedinstaller dot com so we can investigate them.

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”