Accessing curl executable from Program files? - windows

I have built an application which uses user executable through WScript com object.
Now the main program is located in C:\Program files\Myapp
Curl executable is located in C:\Curl
But it looks like my application is unable to execute curl if main application is in Program files.
If i move it to another location it can execute curl nicely.
Problem occurs only on Windows Xp on Vista and Win7 it works perfectly.
Is there any special permissions i have to give to my app or what?

Oh got it finally sorted out.
Actually everything was fine just missed that on Xp there is spaces between in path's just needed to add double quotes to my command and done.

Related

Installing Windows Service fails when command run in batch file

I'm converting a legacy VC 6 C++ Windows Service application to Visual Studio 2022
The conversion is completed and, if I open a CMD prompt with Admin rights, I can install the service using this command:
Service.exe /Install
It installs instantly and starts correctly.
However, I need to install it within an installation script, which loads a bunch of services by calling a batch file which contains the commands to start them. It is run with elevated permissions. However, which it reaches the above line (Service.exe /Install) it hangs. There is no error message and I cannot even terminate it using CTRL + C. The only way around it is to close the CMD prompt. The service is not installed.
My service does not appear in the Task manager's list of processes when the batch file hangs.
I've tried adding the full path to the service in the batch file but it makes no difference. Running this batch file from an elevated command prompt (rather than the installer script) runs into the same problem.
I'm tearing my hair out over this (almost bald now :-)) - can anyone provide any suggestions?
Thanks
Andy
Debugging found a logic error in the start up code.
Basically, calling Service.exe /Install directly from the command line just passes "Service.exe /Install" as the command line, whereas calling it from a batch file / CreateProcess() passes the whole path to the service in the command line and the parser was not taking that into account. Maybe it behaved differently in older Windows versions, but the parser was really badly written.
I'm glad it was me who wrote it :-)

Why does running a .sh script from Visual Studio open the file instead of running it?

I am attempting to run an .sh script (which itself is supposed to kick off a series of unit tests in flask) from within Visual Studio Code running in Windows 10 and for some reason no matter what I try it only opens the file for editing instead of actually running the file.
This is the exact command I am typing:
C:\Users\my.user\MyRepo>.\scripts\run-unit-tests.sh
Here are my notes:
This is a brand new installation of Windows 10 where I believe I have enabled WSL2
I am completely unfamiliar with doing development from within Windows (coming from a Ubuntu/Linux background)
My goal is to run this script from within the built in terminal in VS Code, however I have also tried running it from a cmd prompt and also from powershell and both of those also result in opening the file in VS Code.
Addendum: more notes:
I actually have two windows machines. one is my personal machine, the other provided by my work. For whatever reason this file works fine on my personal machine but does not on my work machine. Also the bash script is in a repo which was created by others at my company so i'm certain that this can be made to run without modifying the .sh file itself.
I figured out what was going on.
In windows there are default file associations. Mine was set up to run Visual Studio Code for the .sh file extension. Also, windows does not know how to handle .sh files by default. There were likely many potential fixes for this however the one that worked was for me to re-associate the .sh file extension to open with Git Bash which I happened to also have installed on this machine.
Thanks all who tried to help.

Setup EXE won't start - without any Error Message

I have created a Setup EXE of my Python program with InnoSetup. On most computers it runs without any problems.
But on some the EXE doesn't do anything at all. No error message or anything like that!
Is there any method for me to check what causes this behaviour?
Also the setup installs to C:\Program Files but when i want to start it it just works with admin rights. Is that normal or am i doing somethin wrong?

Windows deletes make executable file upon running. Why?

I am trying to get some code running which uses make. I've downloaded and installed both MinGW (standard 32 bit) and TDM-GCCs flavor of MinGW on my 64-bit Windows 7 machine.
When I run make (i.e. mingw32-make.exe) in Administrator mode, I get the following error message:
Windows cannot access the specified path, or file. You may not have the appropriate permissions to access the item.
The weird/scary part is that, upon running, it immediately deletes the exe file.
I ran a checksum SHA1 as recommended in the comments using the Microsoft (R) File Checksum Integrity Verifier V2.05:
C:\path\to\folder>fciv.exe -sha1 mingw32-make.exe
//
// File Checksum Integrity Verifier version 2.05.
//
c8ae5c780ab7bed652883d6443b5bfe5e23d30c9 mingw32-make.exe
I don't understand what this output means, but maybe it's helpful to someone.
Notes:
This happens regardless of where the file is located on my pc.
This behavior is specific to the make program (others such as gfortran and gcc appear to be working fine)
Renaming the file makes no difference.
I am an administrator on the pc
Same behavior when I run the program from the explorer or command line.
My anti-virus program (Avast) does not detect any problems with the file when I scan it.
I got the MinGW setup file from this SourceForge page.
I got the TDM-GCC web installer from this page.
The file size is 219,662 bytes (from both the main MinGW and TDM-GCC packages)
I have run make from the command line where I have started the command prompt by way of selecting Run as Administrator in the context menu.
I have also tried to run make by selecting Run as Administrator when I have it selected.
I run the command mingw32-make when this behavior occurs. I have also tried renaming it to things like make and foo with the same result.
The first time this happened with both MinGW it deleted the original file and I re-installed it using the mingw-get application. From thereon after I started making copies of the original mingw32-make for testing.
For the make executable, I have all permissions (including Read & execute) except the special permissions field.
After using the process manager I found out it was indeed Avast that was the problem :S A couple of lines revealed avast actually deleted the file before windows got around to executing it, which was the reason for the windows message. I put Avast on 'Silent Mode' a while back; I thought the only purpose of this mode was to suppress notifications about minor updates, but apparently it also gave Avast permission to deal with 'threats' silently as well.
After figuring that out the solution was straightforward. I just went into the settings and created an exception for the mingw32-make.exe file. It now runs without issue.
Thanks very much for your help everyone!
User account has administrator privilege but when user started to work , not all privilege are taken in account , just start your application for compiling with run with administrator mode try this : https://technet.microsoft.com/en-in/library/cc781763(v=ws.10).aspx

exe command not recognised in win32 folder

I have placed a mycmd.exe file in system32 folder under windows directory.
Strange thing is that this is accessible from command prompt but when i access this file as a shell command from my VB6 application it shows is "not recognized as an internal or external command"
I am running VB project as run as administrator and using win8 64bit.
Thanks for the anticipated help!!
The WOW64 filesystem redirector is probably taking your program's path and changing it.
See: File System Redirector
Can you show the exact code you're using to run the EXE? The error you're getting makes it clear that VB isn't finding the file. Have you tried appending the path to the specific file you're trying to execute?

Resources