PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
[RESOLVED] Utility calculator not Running-VBForums
Results 1 to 9 of 9

Thread: [RESOLVED] Utility calculator not Running

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2006
    Location
    PUNE
    Posts
    222

    Resolved [RESOLVED] Utility calculator not Running

    hi,
    i have written following for Code For Running Caculator utility from Application
    VB Code:
    1. On Error GoTo Errhandle
    2.     Dim A As Double
    3.     A = Shell(" C:\WINDOWS\system32\calc.exe", vbNormalFocus)
    4.     Exit Sub
    5. Errhandle:
    6.     MsgBox ("Unable to run Calculator Utility on Your Computer"), vbInformation, "Error in Opening!!!"
    7.     Resume Next

    am Getting Error in Opening

    Thanks in Advance

  2. #2
    Frenzied Member pnish's Avatar
    Join Date
    Aug 2002
    Location
    Tassie, Oz
    Posts
    1,916

    Re: Utility calculator not Running

    You have a space between the " and the C:\...
    VB Code:
    1. A = Shell("C:\WINDOWS\system32\calc.exe", vbNormalFocus)
    Pete

    No trees were harmed in the making of this post, however a large number of electrons were greatly inconvenienced.

  3. #3
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Utility calculator not Running

    "calc.exe" is usually located in c:\windows\, but pnish is right, I had overlooked that blank space.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  4. #4
    Frenzied Member pnish's Avatar
    Join Date
    Aug 2002
    Location
    Tassie, Oz
    Posts
    1,916

    Re: Utility calculator not Running

    Quote Originally Posted by krtxmrtz
    "calc.exe" is usually located in c:\windows\
    That is true of Win98, WinNT & W2K but in WinXP it is System32.
    Pete

    No trees were harmed in the making of this post, however a large number of electrons were greatly inconvenienced.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jan 2006
    Location
    PUNE
    Posts
    222

    Re: Utility calculator not Running

    Thanks pnish

  6. #6
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: [RESOLVED] Utility calculator not Running

    to launch the calculator just use
    VB Code:
    1. Shell "calc", vbNormalFocus
    then it it'll launch it from the location specified in the registry, and you don't have to know if it's in system32 or not.

  7. #7
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: [RESOLVED] Utility calculator not Running

    Quote Originally Posted by bushmobile
    to launch the calculator just use
    VB Code:
    1. Shell "calc", vbNormalFocus
    then it it'll launch it from the location specified in the registry, and you don't have to know if it's in system32 or not.
    Very interesting. Does that work with any other installed applications that have entries in the registry?
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  8. #8
    PowerPoster Keithuk's Avatar
    Join Date
    Jan 2004
    Location
    Staffordshire, England
    Posts
    2,232

    Re: [RESOLVED] Utility calculator not Running

    You can just
    VB Code:
    1. Shell "Calc.exe", vbNormalFocus
    because Calc.exe is in the Windows path whether its in C:\Windows or C:\Windows\System32.
    Keith

    I've been programming with VB for 20 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.

  9. #9
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: [RESOLVED] Utility calculator not Running

    If you look in
    Code:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
    you'll see other apps that can be launched without reference to a path. However, notepad/calc/regedit etc. aren't located there, so i guess if you omit the path (and it's not in the app path key) then it defaults to the windows path as Keith said.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width