Im working on a small project, which isnt exactly going according to plan...
Overview:
We have some .vbs scripts which must be run before explorer.exe starts
so, the best way to do this would be to replace the windows shell with a custom program (login.exe, written in C#) by replacing the registry key, HKLM>Software>Microsoft>Windows NT>Current Version>Winlogon:Shell = login.exe
What is happening:
The user logs in using AD credentials.
Helloworld.vbs is run
When helloworld.vbs finishes and closes, Explorer.exe is run but opens as Windows Explorer, instead of the usual Shell.
Opening TaskManager (alt+ctrl+del > taskmanager) then running explorer.exe, also opens Windows explorer, instead of the Shell.
Reverting the above registry key back to explorer.exe, then logging off and on, opens the Shell.
Any ideas why?
Source code of Helloworld.vbs
Source code of Login.exe
Helloworld.vbs will be rescripted for much more complex things later on. But for now, its testing only.
Im not a C# programmer, I mostly do VBScript.
But a .vbs fails to run when loaded in the above registry key.
Overview:
We have some .vbs scripts which must be run before explorer.exe starts
so, the best way to do this would be to replace the windows shell with a custom program (login.exe, written in C#) by replacing the registry key, HKLM>Software>Microsoft>Windows NT>Current Version>Winlogon:Shell = login.exe
What is happening:
The user logs in using AD credentials.
Helloworld.vbs is run
When helloworld.vbs finishes and closes, Explorer.exe is run but opens as Windows Explorer, instead of the usual Shell.
Opening TaskManager (alt+ctrl+del > taskmanager) then running explorer.exe, also opens Windows explorer, instead of the Shell.
Reverting the above registry key back to explorer.exe, then logging off and on, opens the Shell.
Any ideas why?
Source code of Helloworld.vbs
Code:
wscript.echo("Hello World")
Source code of Login.exe
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace autexplorer
{
class Program
{
static void Main(string[] args)
{
System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
myProcess.StartInfo.FileName = "wscript";
myProcess.StartInfo.Arguments = " C:\\Windows\\Setup\\Scripts\\helloworld.vbs";
myProcess.Start();
myProcess.WaitForExit();
myProcess.Close();
System.Diagnostics.Process myProcess2 = new System.Diagnostics.Process();
myProcess2.StartInfo.FileName = "C:\\windows\\system32\\explorer.exe";
myProcess2.Start();
}
}
}
Helloworld.vbs will be rescripted for much more complex things later on. But for now, its testing only.
Im not a C# programmer, I mostly do VBScript.
But a .vbs fails to run when loaded in the above registry key.
My Computer
- OS
- Windows 7 Enterprise
- CPU
- Intel Pentium Dual E2200 @2.2GHz
- Motherboard
- Gigabyte II-G31
- Memory
- 4GB
- Graphics Card(s)
- Palit GForce 9500GT 1GB
- Sound Card
- onBoard
- Hard Drives
- WesternDigital: 250GB + 1TB + 1TB + 2TB
- PSU
- 450W
- Case
- CoolerMaster CM690
- Cooling
- Corsair H50
- Mouse
- Logitech MX518