Thinkster Posted August 2, 2005 Share Posted August 2, 2005 This is somewhat related to the sysprep script I needed to query MAC Address and look it up in database to find appropriate ComputerName & ProductKey.In the script, ComputerName is represented by the string %strComputername% and Product key is represented by %strProduct%. I have 25 machines and although they need to be pretty much identical,there are a few that will have some external hardware and applications. So I have a few different post install files (postinst1.bat, postinst2.bat.....postinst12.bat,etc.) and what I need to do is Compare the machine name OR product key to something and if it matches, rename the file from postintx.bat to postinstall.bat.I tried this, and the script/command window just exitsIF %strComputername%="Gateway-01" REN postinst1.bat postinstall.bat else echo.IF %strComputername%="Gateway-02" REN postinst2.bat postinstall.bat else echo.IF %strComputername%="Gateway-03" REN postinst3.bat postinstall.bat else echo.What am I doing wrong?? Link to comment Share on other sites More sharing options...
Dahi Posted August 3, 2005 Share Posted August 3, 2005 (edited) Use == instead of =, and you might need quotes around %strComputername%IF "%strComputername%"=="Gateway-03" REN postinst3.bat postinstall.bat else echo. Edited August 3, 2005 by Dahi Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now