S
Sukaeto
Guest
Not sure weather this should be here or Unrelated . . .
Anyway, we're getting ready to roll out new PCs at the Uni (the order has been placed, they should be in in about 2 weeks.)
Someone had the bass-ackward idea of creating a ghost image for each of the about 2000 Faculty & Staff members' PCs (Don't ask. Wasn't my idea. I find it a rather ridiculous waste of time, storage, and bandwidth . . . especially coming from an IT department.) and I've been elected as one of the guys who's gonna make the images.
I'm trying to make this as effortless as possible (to hopefully make it a little less boring and time consuming), so I'm writing a batch file that'll automatically run ghost with the necessary parameters to just make the image without any user intervention (so I can just stick the boot CD in and go on to the next PC.) The only problem is - figuring out how to get a unique name for each .GHO file.
We're having a bunch of outsource guys come in and take all the old PC's offline, so one of the things we're gonna have them do is rename drive C on each machine as they take it down to whatever the username of the person who uses that particular PC happens to be.
There are two of us working on this automated script, and so far, the other guy's written a little applet that'll look at a text file outputed by the DOS 'vol' command, and grab the name of the volume. What we now need to do is set an environment variable to that value. (so that we can pass that variable in a batch file to ghost as the name to use for the image.)
I've managed to get the system("command") function in stdlib to run pretty much ANY command except the 'set' command. It'll run, but won't set/change any environment variables. I've also tried putenv("variable=value") with the same result (app runs, no change in env var.)
I guess I'm just wondering if any of you guys have any experience with these functions, or maybe another (probably better) idea for getting the username into a env variable to use in a batch file. The boot discs I'll be using are modified Bart Network Boot CDs, using Win98. (now, I've been trying to set the variable on a Win2k box . . . I'm thinking maybe, JUST MAYBE, it'll work in 98 . . . but hey, this IS Microsoft we're talking about here.)[/i]
Anyway, we're getting ready to roll out new PCs at the Uni (the order has been placed, they should be in in about 2 weeks.)
Someone had the bass-ackward idea of creating a ghost image for each of the about 2000 Faculty & Staff members' PCs (Don't ask. Wasn't my idea. I find it a rather ridiculous waste of time, storage, and bandwidth . . . especially coming from an IT department.) and I've been elected as one of the guys who's gonna make the images.
I'm trying to make this as effortless as possible (to hopefully make it a little less boring and time consuming), so I'm writing a batch file that'll automatically run ghost with the necessary parameters to just make the image without any user intervention (so I can just stick the boot CD in and go on to the next PC.) The only problem is - figuring out how to get a unique name for each .GHO file.
We're having a bunch of outsource guys come in and take all the old PC's offline, so one of the things we're gonna have them do is rename drive C on each machine as they take it down to whatever the username of the person who uses that particular PC happens to be.
There are two of us working on this automated script, and so far, the other guy's written a little applet that'll look at a text file outputed by the DOS 'vol' command, and grab the name of the volume. What we now need to do is set an environment variable to that value. (so that we can pass that variable in a batch file to ghost as the name to use for the image.)
I've managed to get the system("command") function in stdlib to run pretty much ANY command except the 'set' command. It'll run, but won't set/change any environment variables. I've also tried putenv("variable=value") with the same result (app runs, no change in env var.)
I guess I'm just wondering if any of you guys have any experience with these functions, or maybe another (probably better) idea for getting the username into a env variable to use in a batch file. The boot discs I'll be using are modified Bart Network Boot CDs, using Win98. (now, I've been trying to set the variable on a Win2k box . . . I'm thinking maybe, JUST MAYBE, it'll work in 98 . . . but hey, this IS Microsoft we're talking about here.)[/i]