CreateProcess to run VBS Script

Hello All,

I have a createprocess that runs a bat file which then runs a vbs script. Although it would appear when I run it that all is good it does not edit the registry. When its run it asks me for a username, password, and domain for conducting autologins on reboot. However, when it reboots it still asks for credentials. Here is the kicker, if I run the bat file manually and go through the motions it works perfectly fine. Does anyone have any ideas as to what's going on? Both ways of exectuting it appears the vbs runs properly but through my program it does not edit the registry.

1
2
3
4
5
6
7
8
if(LOGINFlag.State == Unchecked){                          
CreateProcess(TEXT("E:\\Programs\\LogonScript\\Enable.bat"),
	                          NULL,NULL,NULL,FALSE,
                                         CREATE_NEW_CONSOLE,
                                         NULL,NULL,&si,&pi);                                                                        						  
				  WaitForSingleObject( pi.hProcess, INFINITE );
						   LOGINFlag.State = Checked;    
                                   }
Last edited on
Registered users can post here. Sign in or register to post.