Sudhakar
2009-06-27 15:03:01 UTC
I want to execute a VBScript in a Windows XP machine via VC++. this will run
in the user machines, so I'm unaware of the policies and setting applied for
those users.
How to execute that test.vbs file inside VC++ program ?
I wrote an MFC application, and followed the methods below,
1) I used system() function, it works, but I was told that's not the good way
2)then I opted for
ShellExecute(NULL,_T("open"),"C:\\test.vbs",NULL,NULL,SW_SHOW);
it worked but I had a doubt that the "open" verb for the VBScript mmight be
disabled for the VBScript in some of the machines by tech savvy administrators
3) so, i thought of invoking the Wscript.exe explicitly like the call below,
ShellExecute(NULL,_T("open"), ""C:\\wscript.exe
C:\\GPSUpgrade.vbs",NULL,NULL,SW_SHOW);
but this is not working, the GetLastError() returns the Error description "
The spefified module is not found"
Please anybody suggest that How can i call a VBScript from inside a MFC/C++
program in such a way that it bypasses any user policies(the user must have
some basic privileges).
in the user machines, so I'm unaware of the policies and setting applied for
those users.
How to execute that test.vbs file inside VC++ program ?
I wrote an MFC application, and followed the methods below,
1) I used system() function, it works, but I was told that's not the good way
2)then I opted for
ShellExecute(NULL,_T("open"),"C:\\test.vbs",NULL,NULL,SW_SHOW);
it worked but I had a doubt that the "open" verb for the VBScript mmight be
disabled for the VBScript in some of the machines by tech savvy administrators
3) so, i thought of invoking the Wscript.exe explicitly like the call below,
ShellExecute(NULL,_T("open"), ""C:\\wscript.exe
C:\\GPSUpgrade.vbs",NULL,NULL,SW_SHOW);
but this is not working, the GetLastError() returns the Error description "
The spefified module is not found"
Please anybody suggest that How can i call a VBScript from inside a MFC/C++
program in such a way that it bypasses any user policies(the user must have
some basic privileges).