cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jagjit_82
Level 6

copy system na,me to autoexec.bat

Hiiii ,

I want to know if i can copy my system name(computer name) to a bat file(Autoexec.bat) file in Install shield and Basic MSI?

If yes how can i attaint this...

thanks
jagjit
Labels (1)
0 Kudos
(8) Replies
RobertDickau
Flexera Alumni

If you're using the Environment Variables view, you can use [ComputerName] in your settings.
0 Kudos
jagjit_82
Level 6

sir in case if i am not using environment variables view...like in IS project then what should be done
0 Kudos
RobertDickau
Flexera Alumni

If you're talking about an InstallScript project, please search the knowledge base and these forums for "GetComputerName", or perhaps call GetEnvVar to get the value of the COMPUTERNAME environment variable.
0 Kudos
jagjit_82
Level 6

Sir If i am working on basic MSI project,setting environment variables with[computername] in environment's view will also change or update the autoexec.bat file.

I mean will it automatically change the environment variable to [computername] in batch file(AUTOEXEc.bat)
0 Kudos
RobertDickau
Flexera Alumni

You will need to use the same capitalization: ComputerName and not "computername".

But yes, on Windows 9x systems, the value will be expanded into autoexec.bat; on Windows NT-based systems (Windows 2000, Windows XP, and the rest) the environment variable data will be written to the registry, as all environment variables are.
0 Kudos
jagjit_82
Level 6

sir we are using NT based systems....
As you said environment data is written to the registry.Is this means it is also written to the AUTOEXEC.BAT...
If it aint,Then how can i write the environments data to AUTOEXEC.BAT
0 Kudos
RobertDickau
Flexera Alumni

On Windows NT-based systems, my understanding is that autoexec.bat is generally not used...
0 Kudos
jagjit_82
Level 6

but Sir i want to copy the [ComputerName] to AUTOEXEC.bat file......
is there any other way out through which i could attain this
0 Kudos