Kinook Software Forum

Kinook Software Forum (https://www.kinook.com/Forum/index.php)
-   [VBP] General Discussion (https://www.kinook.com/Forum/forumdisplay.php?f=2)
-   -   Script modifications (https://www.kinook.com/Forum/showthread.php?t=5359)

HippyCraig 06-09-2015 12:15 PM

Script modifications
 
I am using VBP to modify a bunch of scripts, I am trying to find a specific step and make some modifications to it, especially using encrypted passwords. Below is what I have but I am not sure about the password property making sure that the password is correct and that the encryption flag is set correctly in the BLD file.

Code:

Dim objApp, objStep, iNewIndex

Set objApp = CreateObject("VisBuildSvr.Application")
objApp.Project.Load "%PROCFILES_FULLPATH%"

'Set Find Step
For Each objStep in objApp.Project.Steps(vbldStepMain)
        If objStep.Name = "Map Drive to Shared Output" and objStep.Action = "Map Drive" Then
                objStep.Checked = True
                objStep.Property("Password") = "SOME_ENCRYPTED_PASSWORD"
                objStep.Property("Username") = "DOMAIN\USER"
                objStep.Property("buildfailsteps") = CBool(0)
                Exit For
        End If
        iNewIndex = iNewIndex + 1
Next


kinook 06-09-2015 08:03 PM

It's not currently possible to define an encrypted step property from script code (you would need to use the step's [undocumented] IObjectProperties interface, which isn't accessible from VBScript). You can create/update an encrypted project macro via Macros.AddEx, so you could do that and then assign the macro's value (i.e., "%MAP_DRIVE_PWD%") to the step property.

HippyCraig 06-09-2015 08:25 PM

so the weird thing is that the if the flag is set through the GUI just running the script to update the password does put some crazy text in the final BLD file.

If I go down the route of creating an encrypted macro how can I set the Encrypted flag creating an object with VBScript.

kinook 06-09-2015 08:36 PM

True, you can update an existing encrypted step property using the usual Step.Property statement. To create/update an encrypted macro value, use AddEx and pass True for the encrypt parameter.

HippyCraig 06-09-2015 08:47 PM

I will give it a try in the morning, just to understand I CANT set the encrypted flag in the XML that is part of the BLD file but if its already set I can update the property and it will encrypt the password for me.

Other option is to store the password in macro and just assign the macro to the password field. I will post my results in the AM

HippyCraig 06-10-2015 09:40 PM

Everything worked out thanks for the help

kinook 07-09-2015 09:26 AM

In v9, encrypted properties can be created via the Step.Property2 property.
http://www.kinook.com/VisBuildPro/Ma...y2property.htm

HippyCraig 07-09-2015 09:29 AM

I will give it a try, I will need to upgrade first:) But this is great news thanks!!!


All times are GMT -5. The time now is 03:05 AM.


Copyright © 1999-2023 Kinook Software, Inc.