GLBasic forum

Main forum => GLBasic - en => Topic started by: MrTAToad on 2009-Aug-11

Title: SHELLEND strangeness
Post by: MrTAToad on 2009-Aug-11
No sure its a bug or not, but I've been trying to use SHELLEND to run an application in a directory (SHELLEND "Update/program.exe"), but it wont execute.
I've also tried moving into the Update directory using SETCURRENTDIR and then running program.exe, but that didn't work either.

The only time it will execute is if the program is in the same directory as the caller program.
Title: Re: SHELLEND strangeness
Post by: Moru on 2009-Aug-12
There might be troubles with what is the active directory when you use the shell, try setting the directory first.
See SETCURRENTDIR()
Title: Re: SHELLEND strangeness
Post by: Kitty Hello on 2009-Aug-13
He did. Didn't he?
Title: Re: SHELLEND strangeness
Post by: Hatonastick on 2009-Aug-13
Two things spring to mind.  Either it's a bug (in GLB or Mr TA Toads code), or it's a 'security feature' of whatever OS this is bring run on.  None of which seems that likely to me.  Is there any limitations put on SHELLEND as far as security goes Gernot?  I'm guessing not otherwise you'd have said so what I just said is a rhetorical question...

Other possibilities include things like security programs that watch what programs are run on your machine and prevent anything executing that they aren't sure of.  I remember something odd that happened on the PC of a friend of mine that was traced back to one of the myriad of security programs he had running to protect against viruses, malware, trojans and the like.  Not talking about Virus Checkers per se...  Sorry brains not functioning so can't think of the proper name.  ;/
Title: Re: SHELLEND strangeness
Post by: MrTAToad on 2009-Aug-13
I wouldn't be surprised if its Vista's security features getting in the way.  Saying that, however, doing the same thing with SHELLCMD works...
Title: Re: SHELLEND strangeness
Post by: Hatonastick on 2009-Aug-13
Hmm bug with GLB under Vista maybe?  Got any example code that doesn't work on your machine?  I run XP and would be happy to try it and see if it works here.
Title: Re: SHELLEND strangeness
Post by: MrTAToad on 2009-Aug-13
I'm using the following :

Code (glbasic) Select
IF SETCURRENTDIR(UPDATE_DIR$)=TRUE
    SHELLEND webDownloadFiles$[1]+" "+tempDir$


UPDATE_DIR$ is the directory to be moved to - in this case Update
WenDownloadFiles$[1] contains the filename (which exists) and tempDir$ contains the current directory

It appears, that batch files, in the current directory are fine - but not executables.  I suspect Vista's UAC mucking around...

Title: Re: SHELLEND strangeness
Post by: Kitty Hello on 2009-Aug-14
pack a working bug example together, please.
Title: Re: SHELLEND strangeness
Post by: MrTAToad on 2009-Aug-14
Okay - will do!

I've included a small test example.

[attachment deleted by admin]
Title: Re: SHELLEND strangeness
Post by: Kitty Hello on 2009-Aug-14
a bat file i no executable: try SHELLEND "cmd.exe /K \"Update\\update.bat\""

You must place the update in the .app dir.