Open .exe without Shell (1 Viewer)

kevnaff

Member
Local time
Today, 17:09
Joined
Mar 25, 2021
Messages
141
Hello All.

Our IT Department has blocked us from using the cmd shell meaning that we can no longer open .exe using the code we used to below:

Code:
    Dim stAppName As String
    Dim stHomepath As String
    Dim myPath As String

myPath = "H:\QA90PRO32\QA90PRO.exe"
Call Shell(myPath, 1)

Exit_CommandQA90Home_Click:
    Exit Sub

Err_CommandQA90Home_Click:
    MsgBox Err.Description
    Resume Exit_CommandQA90Home_Click

Is there an easy way to open a .exe without using the shell command?

Thanks all.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 09:09
Joined
Oct 29, 2018
Messages
21,467
Just curious, does FollowHyperlink work?
Code:
Application.FollowHyperlink myPath
 

Moosak

New member
Local time
Today, 17:09
Joined
Jan 26, 2022
Messages
26
You can use this code also :
Code:
Public Declare PtrSafe Function FileProtocolHandler Lib "url.dll" _
      Alias "FileProtocolHandlerA" (ByVal hwnd As Long, ByVal hinst As Long, _
      ByVal lpszCmdLine As String, ByVal nShowCmd As Long) As Long

Public Sub OpenHyperlink(ByVal Url)
  FileProtocolHandler 0, 0, Url, 1
End Sub
And call it this way :
Code:
OpenHyperlink "H:\QA90PRO32\QA90PRO.exe"
 
Last edited:

Pat Hartman

Super Moderator
Staff member
Local time
Today, 12:09
Joined
Feb 19, 2002
Messages
43,257
@Moosak welcome aboard. You are relatively new but haven't posted much. Can you explain why you would recommend using a Windows API call rather than native Access code? Is there something about it that is better, in which case we'd love to know that.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 17:09
Joined
Sep 12, 2006
Messages
15,652
What does that exe file do? Seriously the IT dept does not run a company. If there is no danger from QA90PRO then someone with authority needs to exert some authority over the IT dept. It's supposed to be a service.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 11:09
Joined
Feb 28, 2001
Messages
27,171
Dave is right, but here is the politically correct way to do this. IF your project is something that someone else wants and that is important to the company, you go to the person who wants it and reveal that the IT group is hindering progress. This will of course tick off the IT group and they will hate you forever, but that's OK because they would do that anyway if you weren't one of them. But you get the person who wants/needs/mandates this project to exert the pressure so you can concentrate on the technical issues.
 

June7

AWF VIP
Local time
Today, 08:09
Joined
Mar 9, 2014
Messages
5,470
FollowHyperlink can open exe (tested with "C:\Program Files (x86)\Microsoft Office\Office14\Excel.EXE"). However, get a warning popup "Some files can contain viruses ... Would you like to open this file?"

Moosak's code does not do that.
 
Last edited:

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 00:09
Joined
May 7, 2009
Messages
19,230
you can also use:

dim sFilePath As String
sFilePath = "C:\Program Files (x86)\Microsoft Office\Office14\Excel.EXE"
CreateObject("Shell.Application").Namespace(0).ParseName(sFilePath).InvokeVerb "Open"
 

KitaYama

Well-known member
Local time
Tomorrow, 01:09
Joined
Jan 6, 2022
Messages
1,540
Seriously the IT dept does not run a company.
They don't run the company, but they are paid to secure the company against any possible risk. It's their job to protect the company and maintain a virus/malware free environment to work.
Preventing running exe files is the first basic task any IT group would do. It's written on the first page of any security handbook.
You can't blame them for doing their job, what they are paid for.

I can't believe someone with Doc's knowledge and experience (specially being in navy, a very systematic and secure organization) supports the idea.
 
Last edited:

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 17:09
Joined
Sep 12, 2006
Messages
15,652
They don't run the company, but they are paid to secure the company against any possible risk. It's their job to protect the company and maintain a virus/malware free environment to work.
Preventing running exe files is the first basic task any IT group would do. It's written on the first page of any security handbook.
You can't blame them for doing their job, what they are paid for.

I can't believe someone with Doc's knowledge and experience (specially being in navy, a very systematic and secure organization) supports the idea.

I looked up QA90Pro and I can't tell precisely what it is, but if it's been installed, the IT dep't must think it's legitimate.
I stand by my thoughts, anyway.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 17:09
Joined
Sep 12, 2006
Messages
15,652
Top od my Google was

This is the client program for Aquarius Soft PC Remote Shutdown Professional. FREE.
Me too, but I wasn't sure what it actually did! Would that be dangerous? in general would invoking a shell to a .exe be dangerous? I presume you don't want malware firing off programmes, but preventing all legitimate reasons for doing that seems over the top.

I couldn't remember how I call ftp services from inside Access. I thought it might have been "shell"

It's actually the windows API, inside a function called ExecCommand I got from somewhere.
Declare Function CreateProcessA Lib "kernel32" _

Maybe the OP can do that rather than "shell". It still calls ftp.exe, but maybe this way has more control?


edit. From a closer review I think @Moosak suggested a possibly easier way of achieving the same thing earlier, with a different function that was new to me.
 
Last edited:

Gasman

Enthusiastic Amateur
Local time
Today, 17:09
Joined
Sep 21, 2011
Messages
14,263
Me too, but I wasn't sure what it actually did! Would that be dangerous?
I posted that as when I give search criteria to my sister and she Googles that criteria, she ends up with different links to me?
 
Last edited:

NauticalGent

Ignore List Poster Boy
Local time
Today, 12:09
Joined
Apr 27, 2015
Messages
6,329
Ture it is IT's responsibility to protect the network. But instead of being obstructive, they have a responsibility to help the company to get to "yes". In my experience, they are sorely lacking in that area...
 

KitaYama

Well-known member
Local time
Tomorrow, 01:09
Joined
Jan 6, 2022
Messages
1,540
But instead of being obstructive, they have a responsibility to help the company to get to "yes"
You mean allowing firing exe files from a database? May I ask why a database needs executing an exe file?
 

NauticalGent

Ignore List Poster Boy
Local time
Today, 12:09
Joined
Apr 27, 2015
Messages
6,329
I cant speak to why any developer needs to anything with their app. A customer's requirement changes from situation to situation. IT needs to understand it and TRY to help them meet their requirement instead of doing a blanket denial.
 

Gasman

Enthusiastic Amateur
Local time
Today, 17:09
Joined
Sep 21, 2011
Messages
14,263
When I worked for one of the large banks here in the UK, the IT dept despite having written two small Access DBs for the PPI dept, refused to create one that would greatly save time and money for the bank.
So despite just being an admin person, I was asked to create it. :)

Had a great two weeks, coming in early, leaving late, and then when I went back to my assigned job, 8 to 4 on the dot. :)
 

NauticalGent

Ignore List Poster Boy
Local time
Today, 12:09
Joined
Apr 27, 2015
Messages
6,329
You mean allowing firing exe files from a database? May I ask why a database needs executing an exe file?
I had a similar situation where I wanted to load the contents of a LongText/Memo field into Notepad (an exe). We were able to do it for years until one day, some jackass in IT changed it. After a few phone calls and repeatedly being told "no", I changed the app and simply loaded it into a form instead. The boss didn't like the way it looked so I told him that there was nothing I could do.

He called his counterpart in IT and within a day, the same jerks that told me "no way" couldn't WAIT to help me. All of this could have been avoided if they would have took the time to understand what we needed it for instead of crossing their arms and shaking their heads.
 

KitaYama

Well-known member
Local time
Tomorrow, 01:09
Joined
Jan 6, 2022
Messages
1,540
the same jerks that told me "no way" couldn't WAIT to help me.
You see? there's the point. The one who you believe was a jerk, was simply doing his job. When it's his responsibility for security, he stops any possible vulnerability.
When the boss says go for it, then the response is "For sure". From that point there's an order to be more flexible and if anything happens, it's not his responsibility. You may think he was a jerk, but he's doing what he's supposed to.
 

NauticalGent

Ignore List Poster Boy
Local time
Today, 12:09
Joined
Apr 27, 2015
Messages
6,329
You see? there's the point. The one who you believe was a jerk, was simply doing his job. When it's his responsibility for security, he stops any possible vulnerability.
When the boss says go for it, then the response is "For sure". From that point there's an order to be more flexible and if anything happens, it's not his responsibility. You may think he was a jerk, but he's doing what he's supposed to.
That is not the point. When I called him, he could have taken the time to ask his boss if an exception could be made. He could have taken the time to understand that Notepad is not a dangerous exe and advocated for me so that I did not have to get "big dogs" involved.

He was not happy about having to help me and was quite pissy about it - and I have to admit I enjoyed his displeasure a little more than I should have. Again, the whole thing could have been avoided had he not been a rigid jackass.
 

Users who are viewing this thread

Top Bottom