See http://technet.microsoft.com/en-us/library/ff715408.aspx for FirstLogonCommand
, how do I specify a CommandLine
for the OS boot drive and not just use "C:" like the examples do. The OS boot drive might not be "C:".
Update: I am using C++ to write the XML and the program that will run is also written in C++.
The
%SystemDrive%
environment variable is set to the operating system drive in Windows and can be replaced into most commands.Interesting question. No help from Microsoft (as usual).
%SystemDrive% environment var is normally what you would use in scripts and such, but this is not really a script.
Frankly I have no idea if it will work in this particular fringe case.
If the system passes whatever is in the XML straight to cmd.exe it will work.
If it goes, with out expanding the environment var, directly into the exec() call of the Windows-API it is doubtful it will work.
You will just have to try it. As there is no visual feedback while this runs I recommend you run something that writes a logfile in a known location so you can be certain whether it worked or not.
Another solution comes to mind: Assuming that, while this runs, the current drive IS the OS drive you might just get away without specifying the drive at all. Just use the full part from the top of the drive without the drive-letter and colon.
E.g: \synccommands\run1.exe
Let us know how this turned out. I for one am interested if one of those solutions works and I don't have the time nor the equipment to experiment myself.