Results 1 to 7 of 7

Thread: open notepad

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485
    Nothing fancy, I just want to open notepad visually. Is it something like:

    Shell.exe "C:\WinNT\notepad.exe"?

  2. #2
    Fanatic Member
    Join Date
    Sep 1999
    Location
    Bethel, North Carolina, USA
    Posts
    987

    Almost...

    Code:
    Shell "C:\WinNT\Notepad.exe"
    {Insert random techno-babble here}

    {Insert quote from some long gone mofo here}

  3. #3
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    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

  4. #4
    Fanatic Member
    Join Date
    Sep 1999
    Location
    Bethel, North Carolina, USA
    Posts
    987

    Wink

    To get the accurate windows directory check out this thread.
    {Insert random techno-babble here}

    {Insert quote from some long gone mofo here}

  5. #5
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    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

  6. #6
    Guest
    If Notepad.exe is located in the default Windows directory, you don't even need to include the directory.


    Code:
    Shell "Notepad.exe", 1

  7. #7
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    736
    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
  •  



Click Here to Expand Forum to Full Width