Jump to content

Assigning a variable the result of a function


Recommended Posts

Goodmorning. I am having trouble assining the result of a funtion to a variable in a batch file. I am using compname.exe to generate a computername(compname.exe /d ?s) I want to assign this to a variable so it can be used with sysprep and the UserData section. Here is what I have

Set strComputername = compname.exe /d ?s

echo Computername ="%strComputername%" > sysprep2.inf

Later the sysprep2.inf will be combined using the copy command, but I need this problem resolved. Thanks in advance for any help you provide it is greatly appreciated.

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...