Using VBScript to control an MMC object -


alright, so, i'm working on script execute commands in mmc snapin, , i'm not experienced doing kind of scripting, i've made lot of progress...the problem having, if create new object every time script runs, massively delay overall script while snapin , in loads(which can take long 5 minutes). if load snapin content once , take control of needed, , create new object if there's not 1 open already, i'll save massive amount of time when run script 100 times in day.

the problem is, i'm not entirely how achieve this. thought, after research, getobject, when

dim objmmc set objmmc = getobject("", "mmc20.application") 

it seems create new mmc window no snapins loaded, rather existing 1 snapins loaded want.

any advice? totally off base here, using wrong command, or there simple change can make fix this?

edit: there weird workaround way achieve this, storing object temporary file can @ least reuse through single session.

i'm in weird situation trying add functionality powershell script , couldn't find way directly in powershell, i'm setting vbscript 1 piece of , calling vbscript powershell. had lot of research figure out how in vbscript(and i'm still not sure of it) guess before go further, i'll try figure out if viable(in vbscript or c# or c++ or other language suggest)...

what want do, overall, check if mmc window open contains dhcp snapin. if so, assign variable. if not, create one. read csv or txt file, , use values determine node navigate within snapin(dhcp>servername>ipv4>scopename>scope options).(i've solved part in vbscript, don't know how in c++ or c#) finally, need able execute right-click menu item "configure options", navigate tabs of popup comes up, enter value, , apply changes/hit ok close popup. worst case, if can't "normally" sending commands objects themselves, part can imitating keystrokes, don't want if it's avoidable because it's sloppy. then, need somehow alert powershell script i'm "finished" can continue, or give alert if there's error.

i'm not asking walk me through this, want know if of steps aren't viable i've described them, if i'm going have switch c++ or c# achieve first part , therefore relearn commands needed.

... , create new object if there's not 1 open ...

no, not possible in vbs, need do

dim objmmc set objmmc = wscript.createobject("mmc20.application") 

if create new object every time script runs, massively delay overall script

in case vbs wrong language, need use c# or c++ executable.


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -