PDA

View Full Version : Pass Dialog Box information to Batch File



ender
04-15-2012, 10:35 PM
Is there a way to create a batch file using information from a dialog box? I can create a batch file using the “Handle Text File Operation”, however I cannot pass information taken from a dialog box. For example, I want to take the username (%_SB_USERNAME%) gathered from a dialog box, then pass it into my batch file for to run during installation.

linder
04-16-2012, 12:18 AM
Hello,

Of course, you can do this :) See attached quick-and-dirty "CreateBatch.sb7" demo project. You can enter the User Name and the installer will create a c:\test\test.bat batch file for you.

Does this help?

Friedrich

ender
04-16-2012, 09:56 AM
Thank you for the quick response.

I saw something similar in a post last night.

What I need is create a bat file during the installation and pass user information to it. This is for our remote Terminal Server users.

For example:

Create Folder “C:\test”
Text File: Create File “c:\test\test.bat”
Text File: Insert Line “” to “c:\test\test.bat” – user:DOMAINNAME\%_SB_USERNAME% /pass:PASSWORD

The %_SB_USERNAME% value would come for a Welcome dialog box during the initial run, then pass the variable to the batch script.

linder
04-16-2012, 10:25 AM
The attached modified .sb7 project creates a test.bat with the following contents:

user:DOMAINNAME\JoeUser /pass:PASSWORD

"JoeUser" comes from the %_SB_USERNAME% variable. Of course, you can use your own runtime variable here.

Is this what you are looking for?

Friedrich