Exec to get the PowerShell output with the StdOut property? Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 7 years, 8 months ago. Active 7 years, 8 months ago. Viewed 2k times. Carlos Gil. Carlos Gil Carlos Gil 2 2 gold badges 9 9 silver badges 25 25 bronze badges. Why not open it through VBScript?
CreateObject "UserAccounts. CommonDialog" is not on Windows 8, which is what I need. Quit Else Wscript. FileName End If. My Archive. Close Box. Log In Come Join Us! Posting Guidelines Promoting, selling, recruiting, coursework and thesis posting is forbidden. If you have ever wanted to force a user to select a file you have wondered how to use the commonly used "File Open Dialog" from windows. Most windows applications use the same dialog window, this is called a "Common Dialog".
The below FAQ will help answer that question. Keep in mind that version changes in VB, VBScript, and Windows may prevent code demonstrated from working in all instances. This code works for Windows and XP at the time of posting. The first step is to create an Object type variable in VB. The "UserAccounts. CommonDialog" is the class of object we are creating. This is that File Open Dialog we want. You can change "ObjFSO" to some longer name that makes more sense for you, it is our variable.
It is important to note that we have not yet opened the dialog! Ensure that mscomdlg32ocx is registered for this to work. CommonDialog" With objDialog. Echo "You pressed 'Cancel' please try again. Quit Else WScript. Echo objDialog. FileName End If. Tuesday, July 20, AM. I download the mscomdlg Any helps? Tuesday, July 20, PM. Monday, July 26, PM. And I have tried to register the mscomdlg Could you help me? Wednesday, July 28, AM. Wednesday, July 28, PM. Hi LikeTocode, I think that if your vbs can work, you also should register the mscomdlg So,could you tell me how can you let your vbs work?
I will be very appreciate if you can help me. Saturday, July 31, AM. Hi LikeToCode, Thank you for your information. Now I can register the. And I run the vbs you write again after a system restart. But the result is still fail : There is still a Error dialog pop up when run the vbs, and the error message is like "AcitveX component can't create object:'MSComDlg. Tuesday, August 3, AM. All, I also face the same problem, i have run regsvr32, and "succeded" but when i run the script, the error message still the same any other thing i have to do?
Sunday, February 6, PM. Hi, I know this is an old topic, but if people stuggled with it google for it I mean Bing for it! Here it is the code is a bit long, but it works : Option Explicit WScript. Wednesday, October 19, PM.
This worked great for what I wanted. How can this be modified to provide a Save As dialog? Friday, January 13, AM. How can this be modified to provide a Save As. Sorry this topic has beenclosed fo almost a year. PLease start a new topic. This code will only work in Windows XP! Wednesday, August 1, AM. Exec "mshta.
0コメント