PDA

Click to See Complete Forum and Search --> : To read from registry


pam1
Aug 1st, 2000, 11:19 AM
I'm opening wordpad through my application. The application is used on multiple platforms. I need to find the path to locate wordpad and store in a variable which I can pass using the shell command. Any help will be appreciated.

'get path and assign to variable
'i = shell(variable,1)
'Instead of hardcoding as below
i=shell ("C:\Program Files\Windows NT\Accessories\wordpad.exe",1)

IrishJoker
Aug 3rd, 2000, 06:28 AM
Use the FindFirstFile API function.
Send it the windows path and wordpad.exe.
This should find the file.
You can find reference to this on http://www.vbapi.com

Hope this helps.

IJ

privoli
Aug 3rd, 2000, 07:57 AM
RetVal = Shell("wordpad.exe",1)

That will check the current OS path and run wordpad.exe from it, will work on most Windows installations, inclduing NT, 9x, 2000 etc...