Click here to Skip to main content
15,903,201 members
Home / Discussions / C#
   

C#

 
GeneralRe: Switching on type Pin
musefan1-Dec-10 2:55
musefan1-Dec-10 2:55 
AnswerRe: Switching on type Pin
Keith Barrow1-Dec-10 1:18
professionalKeith Barrow1-Dec-10 1:18 
GeneralRe: Switching on type Pin
musefan1-Dec-10 1:24
musefan1-Dec-10 1:24 
GeneralRe: Switching on type Pin
Keith Barrow1-Dec-10 1:52
professionalKeith Barrow1-Dec-10 1:52 
GeneralRe: Switching on type Pin
PIEBALDconsult1-Dec-10 2:26
mvePIEBALDconsult1-Dec-10 2:26 
GeneralRe: Switching on type Pin
Pete O'Hanlon1-Dec-10 2:57
mvePete O'Hanlon1-Dec-10 2:57 
AnswerRe: Switching on type Pin
PIEBALDconsult1-Dec-10 2:28
mvePIEBALDconsult1-Dec-10 2:28 
QuestionCall XP Mode shortcut programmatically [modified] Pin
spif200130-Nov-10 20:36
spif200130-Nov-10 20:36 
Hi
I'm trying to call a XP Mode shortcut programmatically, but I keep getting the same error message:

"problem starting C:\windows\system32\VMCPropertyHandler.dll The specified module could not be found"


I tried with the following:

string startPath = @"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup";<br />
Process p = new Process();<br />
p.StartInfo.FileName = startPath + "\\XPModeInitializer (Windows XP Mode).lnk";<br />
p.StartInfo.UseShellExecute = true;<br />
p.Start();



But I have also done many variants. I even tried making a bat file, that just call the link. The bat file itself works when double-clicked, but when called from within my code like the following snippet, I get the same error message:

Process p = new Process();<br />
p.StartInfo.FileName = Environment.CurrentDirectory + "\\CallXPModeInitializer.bat";<br />
p.StartInfo.UseShellExecute = true;<br />
p.Start();



I also tried taking the shortcut parameters and using them myself like this:

string file = System.Environment.SystemDirectory + @"\rundll32.exe";<br />
string arguments = System.Environment.SystemDirectory + @"\VMCPropertyHandler.dll,LaunchVMSal ""Windows XP Mode"" ""||a9c104ed"" ""XPModeInitializer""";<br />
Process p = new Process();<br />
p.StartInfo.FileName = file;<br />
p.StartInfo.Arguments = arguments;<br />
p.StartInfo.UseShellExecute = true;<br />
p.Start();



But it produces the same error message,
I'm confused at to why a direct use of the bat file works, when the call to the bat file from within C# fails!?

How can I call a XP Mode shortcut from within C# code?
I'm in the high-fidelity first class traveling set.
And I think I need a Lear jet.

modified on Wednesday, December 1, 2010 4:35 AM

AnswerRe: Call XP Mode shortcut programmatically Pin
Rajesh Anuhya30-Nov-10 22:27
professionalRajesh Anuhya30-Nov-10 22:27 
GeneralRe: Call XP Mode shortcut programmatically Pin
spif200130-Nov-10 22:35
spif200130-Nov-10 22:35 
AnswerRe: Call XP Mode shortcut programmatically Pin
Eddy Vluggen1-Dec-10 1:23
professionalEddy Vluggen1-Dec-10 1:23 
GeneralRe: Call XP Mode shortcut programmatically Pin
spif20011-Dec-10 1:52
spif20011-Dec-10 1:52 
GeneralRe: Call XP Mode shortcut programmatically Pin
Eddy Vluggen1-Dec-10 2:32
professionalEddy Vluggen1-Dec-10 2:32 
QuestionMultiple query results on one form. Pin
Joe Stansfield30-Nov-10 18:36
Joe Stansfield30-Nov-10 18:36 
AnswerRe: Multiple query results on one form. Pin
Pete O'Hanlon30-Nov-10 22:23
mvePete O'Hanlon30-Nov-10 22:23 
GeneralRe: Multiple query results on one form. Pin
Joe Stansfield1-Dec-10 11:29
Joe Stansfield1-Dec-10 11:29 
Questionin microsoft report viewer i want change datasource in run time Pin
Nabawoka30-Nov-10 10:18
Nabawoka30-Nov-10 10:18 
AnswerRe: in microsoft report viewer i want change datasource in run time Pin
Pete O'Hanlon30-Nov-10 11:32
mvePete O'Hanlon30-Nov-10 11:32 
GeneralRe: in microsoft report viewer i want change datasource in run time Pin
Nabawoka30-Nov-10 19:24
Nabawoka30-Nov-10 19:24 
AnswerI Get it :D:D ;) Pin
Nabawoka30-Nov-10 22:12
Nabawoka30-Nov-10 22:12 
GeneralRe: I Get it :D:D ;) Pin
Pete O'Hanlon30-Nov-10 22:24
mvePete O'Hanlon30-Nov-10 22:24 
Questionerror while backup DB from C# "Backup failed for Server" [modified] Pin
Nabawoka30-Nov-10 9:53
Nabawoka30-Nov-10 9:53 
AnswerRe: error while backup DB from C# "Backup failed for Server" Pin
Henry Minute30-Nov-10 13:36
Henry Minute30-Nov-10 13:36 
QuestionHow to block shutdown/logoff in Windows Vista? Pin
turbosupramk330-Nov-10 9:43
turbosupramk330-Nov-10 9:43 
AnswerRe: How to block shutdown/logoff in Windows Vista? Pin
Pete O'Hanlon30-Nov-10 10:10
mvePete O'Hanlon30-Nov-10 10:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.