Run Windows 7 SoundRecorder.exe from within access

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • accessnewbie90
    New Member
    • Aug 2013
    • 7

    Run Windows 7 SoundRecorder.exe from within access

    I tried to run SoundRecorder.e xe (located in C:\Windows\Syst em32\SoundRecor der.exe) in windows 7 using a command box in access but for some strange reason I get a Run time 53 error saying that the file was not found.

    Code:
    -----------------
    Code: 
    Call Shell("C:\Windows\System32\SoundRecorder.exe", 1)
    -----------------
    when I use the mspaint.exe instead of SoundRecorder.e xe in the code above the Paint starts normally.

    Also, when I type
    C:\Windows\Syst em32\SoundRecor der.exe
    in Windows>Run the sound recorder starts normally.

    I have spent days trying to figure out what is happening with the SoundRecorder.e xe. I even tried to create a bat file to launch it from access and again, when the bat file is manually clicked the Soundrecorder starts normally but when the bat file is invoked from within access it again pops up an error saying the windows cannot find "SoundRecorder. exe"

    Any help?
    Last edited by zmbd; Aug 2 '13, 08:37 PM. Reason: [z{placed required code tags}]
  • jimatqsi
    Moderator Top Contributor
    • Oct 2006
    • 1290

    #2
    Experiment a bit. Try moving the .exe into the same folder as the Access program. If it works there it may indicate there's a problem with permissions. Are you on a network or a standalone workstation?

    You might find something helpful in the Windows log file.

    Comment

    • accessnewbie90
      New Member
      • Aug 2013
      • 7

      #3
      Thanks jimatqsi.
      I tried to copy/paste the SoundRecorder.e xe in the database location. No "file not found" error but of course the SoundRecorder.e xe doesn't run. I read somewhere that the root of the problem is Windows 64bit ( http://www.kirbyfooty.com/forum/inde...pic=669.0;wap2) and tried a couple of workarounds but with no lack.

      PS 1. I don't know how to deal with windows log file
      PS 2. I am on a standalone pc (Win 7 x64).


      Originally posted by jimatqsi
      Experiment a bit. Try moving the .exe into the same folder as the Access program. If it works there it may indicate there's a problem with permissions. Are you on a network or a standalone workstation?

      You might find something helpful in the Windows log file.

      Comment

      • jimatqsi
        Moderator Top Contributor
        • Oct 2006
        • 1290

        #4
        After reading that and taking it at face value, I think you might want to search for FreeSoundRecord er.exe on the net. See if that will work for your application.

        Comment

        • zmbd
          Recognized Expert Moderator Expert
          • Mar 2012
          • 5501

          #5
          Windows7 did a few things with security behind the scenes and much of this has not been explained.
          We ran into a similar issue with an instrument control program. Appears that Win7-64 will sometimes handle a wrong path and sometimes wont - don't ask, we (read my company’s IT, their IT, and myself) still don't get it!

          Before you go downloading another program: You might just do a search on the drive for where "SoundRecorder. exe" is actually located. I think it was moved, I am however at home and on a WinXP OS (at work Win7-64) or I would take a peek at it myself :-(

          Also hang tight for a short while, someone else here may have a better way to shell out the call to the SoundRecorder.e xe that is more reliable.
          Last edited by zmbd; Aug 2 '13, 05:03 PM.

          Comment

          • accessnewbie90
            New Member
            • Aug 2013
            • 7

            #6
            @jimatqsi
            I might go for HarddiskOgg (http://www.fridgesoft.de/news.php). Thanks anyway

            Comment

            • BikeToWork
              New Member
              • Jan 2012
              • 124

              #7
              Try c:\windows\syst em32\. That is where SoundRecorder.e xe is located on my Win7/64 computer.

              Comment

              • accessnewbie90
                New Member
                • Aug 2013
                • 7

                #8
                @zmbd

                It is completely insane. I created a .bat file with:

                Code:
                @echo off
                cd C:\Windows\System32\
                start SoundRecorder.exe
                When I click the bat file, the SoundRecorder starts. When I call the bat file from within access I get an error.

                ~XC

                Comment

                • accessnewbie90
                  New Member
                  • Aug 2013
                  • 7

                  #9
                  @ BikeToWork

                  As mentioned in my first post, I use the c:\windows\syst em32\ directory

                  Comment

                  • BikeToWork
                    New Member
                    • Jan 2012
                    • 124

                    #10
                    Sorry about that @accessnewbie90 . For some reason I thought you were trying C:\Windows\Soun dRecorder.exe. I have Windows 7 64 bit and Access 2007. When I make a function with the same code as yours (Call Shell("C:\windo ws\system32\sou ndrecorder.exe" , vbMaximizedFocu s), I got runtime error 53 - File not Found. If I paste the same path (C:\windows\sys tem32\soundreco rder.exe) into the "Run" field, it opens fine. This is indeed strange.

                    Comment

                    • BikeToWork
                      New Member
                      • Jan 2012
                      • 124

                      #11
                      I copied soundrecorder.e xe to my D: drive and it opens fine from the Shell command in Access. It must be a Windows 7 security "feature" on the System32 folder.

                      Comment

                      • zmbd
                        Recognized Expert Moderator Expert
                        • Mar 2012
                        • 5501

                        #12
                        From the little bit of research and some supposition on my part, it does appear to be a setting within the System32 folder.

                        When you ran the batch file how did you call it within VBA?
                        Code:
                        Call Shell([pathtobatchfile], 1)

                        Comment

                        • zmbd
                          Recognized Expert Moderator Expert
                          • Mar 2012
                          • 5501

                          #13
                          I know what happened:
                          You got hit with the EXACT same thing that we did in the lab with the instrument software!

                          I had one of my collegues lookup how we solved the issue in the lab (good to keep notes).

                          I then had him check the for the soundrecorder in the SysWOW64 on our Win7(64), and sure enough, there it sits.

                          Here's the information that helped us solve the problem back then... (Sorry, I'd forgotten exactly how we solved the issue, been too many years and too many projects, and three kids! I should have checked my notes sooner; however, I'm not at work and they are not as easy to get to!)

                          Calling a 32bit System Command in a Script in x64 windows
                          Let’s say you’ve written a little 32-bit script that calls a Windows command such as nbtstat. When you try to run the script in x64 Windows, you get an annoying “File not found” error – even though you can see the command sitting in the \Windows\system 32 folder.

                          What’s going on here?

                          x64 version of Windows have two system folders: \Windows\system 32 and \Windows\SysWOW 64.

                          The 32-bit commands are in the SysWOW64 folder, and the 64-bit commands are stored in the system32 directory. x64 Windows looks in system32 by default when you call a command line function, since it tries to call the 64-bit goodies (no, that’s not backwards!).

                          So, you might think that you can simply change your script to explicitly call, for example, \Windows\system 32\nbtstat instead of just nbtstat, and you’ll be off and running, right? Wrong.(...)
                          So, try the path "c:\windows\sys native\SoundRec order.exe" and see if this works.

                          If so, then you can modify the Ruby code given for VBA to check for the SysWow64 directory using the DIR() function and then either execute the call based on the straght System32 folder if it doesn't exsit or call the Above link
                          Last edited by zmbd; Aug 2 '13, 08:56 PM.

                          Comment

                          • accessnewbie90
                            New Member
                            • Aug 2013
                            • 7

                            #14
                            @ zmbd

                            Thanks for taking the time to address the problem. I tried the path "c:\windows\sys native\SoundRec order.exe" and I got a:

                            Run-time error "5"
                            Invalid procedure call or argument


                            I am now using a free alternative to SoundRecorder and it works just fine. It is still weird though that there is no problem with other windows apps (like MSpaint for example). Only SoundRecorder seems to have this problem.

                            Comment

                            • zmbd
                              Recognized Expert Moderator Expert
                              • Mar 2012
                              • 5501

                              #15
                              Given that you were getting: "Run time 53 error saying that the file was not found."

                              The runtime 5 error indicates that you attempted to pass an argument that Shell() doesn't understand and it must have found the soundrecorder.e xe or you would have received a different error... more than likely the 53 again.

                              SO I wonder are you trying to use one of the built in constaint such as "vbMaximizedFoc us?" IF so the you may have to use the numeric "1" - Win7(64) has some quirks like that.

                              The other thing is how your quotes are being used and if there are any spaces and they are being used in the call to the program.

                              Would you please post the actual code that caused the error?

                              Comment

                              Working...