|
-
Feb 19th, 2001, 05:45 PM
#1
Thread Starter
Hyperactive Member
Nothing fancy, I just want to open notepad visually. Is it something like:
Shell.exe "C:\WinNT\notepad.exe"?
-
Feb 19th, 2001, 05:58 PM
#2
Fanatic Member
Almost...
Code:
Shell "C:\WinNT\Notepad.exe"
{Insert random techno-babble here}
{Insert quote from some long gone mofo here}
-
Feb 19th, 2001, 06:03 PM
#3
_______
<?>
Path may vary and to show it use vbNormalFocus, otherwise it will open minimized by default
Shell "C:\Windows\Notepad.exe", vbNormalFocus
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Feb 19th, 2001, 06:08 PM
#4
Fanatic Member
To get the accurate windows directory check out this thread.
{Insert random techno-babble here}
{Insert quote from some long gone mofo here}
-
Feb 19th, 2001, 06:30 PM
#5
_______
<?>
Code:
You don't need to know the path if you use shelldef
Option Explicit
'Use Shelldef to open a file with the associated app
Private Declare Function ShellEx Lib "shell32.dll" Alias _
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As Any, _
ByVal lpDirectory As Any, ByVal nShowCmd As Long) As Long
'
Sub ShellDef(strFileName)
Dim x As Long
x = ShellEx(Form1.hwnd, "open", strFileName, "", "", 1)
End Sub
Private Sub Command1_Click()
Dim strYourFileVariable$
strYourFileVariable = "Notepad.exe"
ShellDef strYourFileVariable
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Feb 19th, 2001, 07:45 PM
#6
If Notepad.exe is located in the default Windows directory, you don't even need to include the directory.
Code:
Shell "Notepad.exe", 1
-
Feb 20th, 2001, 07:37 AM
#7
Fanatic Member
This should work fine too. You can also pass the name of a file to open in NotePad.
Code:
Shell "NotePad " & sFileName, vbNormalFocus
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|