Sign in to follow this  
Followers 0
t0ddie

problem with run

37 posts in this topic

the most basic things always break with a new version of autoit or when on windows vista.

opt("trayicondebug",1)

Run("d2-cdkey.exe", @ScriptDir, @SW_HIDE)

WinWait("Refill CdKey")

i have the script and the program on the desktop of this laptop computer, running windws vista.

i run the script, and hover the mouse over the icon and it sits on winwait.

why is the program not running?


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites



the most basic things always break with a new version of autoit or when on windows vista.

opt("trayicondebug",1)

Run("d2-cdkey.exe", @ScriptDir, @SW_HIDE)

WinWait("Refill CdKey")

i have the script and the program on the desktop of this laptop computer, running windws vista.

i run the script, and hover the mouse over the icon and it sits on winwait.

why is the program not running?

I make a seperate test script and compile it

while 1

sleep(100)

wend

then i run my script

run("test.exe")

IT WORKS....

why will it run test.exe a program written in autoit but not cdkey.exe

i see some gay thing when i try to run it by hand about unknown publisher but that does not even come up when i try to run it by script.

so basically what is the problem? windows vista wants to hold my hand and not allow me to run software from publishers IT IS UNAWARE OF?

how can i fix this..........!!!!!!


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

the most basic things always break with a new version of autoit or when on windows vista.

opt("trayicondebug",1)

Run("d2-cdkey.exe", @ScriptDir, @SW_HIDE)

WinWait("Refill CdKey")

i have the script and the program on the desktop of this laptop computer, running windws vista.

i run the script, and hover the mouse over the icon and it sits on winwait.

why is the program not running?

I wonder if it has anything to do with @SW_HIDE

:)

Edited by JasonB

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I wonder if it has anything to do with @SW_HIDE

:)

no i tried show too... and i left it blank

i think its some vista admin problem

it dont recognise the publisher when i manually click it, and it just ignored it when i run from script.

program is not running in processes.

hide is not the issue. it is vista. how do i set permissions to allow it to run from unknown publisher.. or cant i

if that is the case, then my script just wont work for vista? i cant have a prompt for user to acknowledge and accept run?

here is the file i want to run. its gay that i need permission to run a file in the first place when i run it manually, but i am not

even given the option with a prompt when i run from script. it just does not run it. no prompt no error. nothing.

http://www.fileshack.us/get_file.php?id=61...;file=cdkey.exe

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

I have been offline for a few weeks, but I see nobody has posted.

Basically I have a program that I want to run from script, on windows vista.

When I click the program manually, It does run... after vista brings up a prompt to ask for permission to run it.

when the run command is called from the script, Instead of running or even attempting to run, the script does nothing and vista does nothing.

Anyone able to give advice and post something that I can use? thanks!


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Not sure if permissions are your issue... but from the helpfile:

Windows Vista brings new security features to restrict the running of files that require administrative rights. Even administrator users will be prompted every time an executable runs which will perform some administrative operation (such as writing to the registry key HKEY_LOCAL_MACHINE or writing to the C:\Windows directory). This is called User Account Control (UAC).

By default AutoIt scripts run with standard user permissions but AutoIt has been coded to allow the script writer the option to "tag" a script in order to tell AutoIt if it needs to run with full admin rights or not.

To force a script to attempt to run itself with administrative rights add the #requireadmin directive at the top of your script

Could you post the full code (or enough for me to run it) if that doesn't work?

Edited by JFee

Regards,Josh

Share this post


Link to post
Share on other sites

opt("trayicondebug",1)
Run("d2-cdkey.exe", @ScriptDir, @SW_HIDE)
WinWait("Refill CdKey")

the program is attached in my previous post.

thanks.


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

opt("trayicondebug",1)
Run(@WorkingDir & "d2-cdkey.exe", @ScriptDir, @SW_HIDE)
WinWait("Refill CdKey")

Assuming the cdkey.exe is in the same folder as this script


Regards,Josh

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

opt("trayicondebug",1)
Run(@WorkingDir & "d2-cdkey.exe", @ScriptDir, @SW_HIDE)
WinWait("Refill CdKey")

Assuming the cdkey.exe is in the same folder as this script

that would be correct, hence @scriptdir Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

A few notes

1) The file I downloaded was "cdkey.exe", not "d2-cdkey.exe"

2) There is a "\" missing from the last post before the name of the file..@WorkingDir & "\cdkey.exe"

3) I generally use @ScriptDir instead of @WorkingDir if the file resides in the same folder as the script (this is not necessary, though)

4) Remove the @SW_HIDE..this executable does not spawn another process, so you are hiding the executable

CODE
opt("trayicondebug",1)

Run(@ScriptDir & "\cdkey.exe", @ScriptDir)

WinWait("Refill CdKey")

I am using XP, so this code worked for me..not sure if it works on Vista, but it did work on Server 2008

Share this post


Link to post
Share on other sites

A few notes

1) The file I downloaded was "cdkey.exe", not "d2-cdkey.exe"

2) There is a "\" missing from the last post before the name of the file..@WorkingDir & "\cdkey.exe"

3) I generally use @ScriptDir instead of @WorkingDir if the file resides in the same folder as the script (this is not necessary, though)

4) Remove the @SW_HIDE..this executable does not spawn another process, so you are hiding the executable

CODE
opt("trayicondebug",1)

Run(@ScriptDir & "\cdkey.exe", @ScriptDir)

WinWait("Refill CdKey")

I am using XP, so this code worked for me..not sure if it works on Vista, but it did work on Server 2008

Thanks for catching my missing "\"

Yeah, I should probably start using @ScriptDir, but I use @WorkingDir by habit. In this case either will work.

@SW_HIDE makes it so the window can not be active (for lack of a better term... I know you can use @SW_ACTIVE but in the case of WinWait it won't be "active") ... because there is no visible window.


Regards,Josh

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

So you want the Windows to be HIDDEN so you can manipulate it offscreen? Are you just not getting the UAC window popup? If that's the case, do you get the UAC popup when you run the file directly?

ALSO..in the post with "while 1...Sleep(100)..WEND....Run("test.exe")"..It seems that the test.exe should NEVER run because of the While 1 loop?

Edited by Varian

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

this is just sample code. perhaps there are a few typos.

opt("trayicondebug",1)
Run("cdkey.exe", @ScriptDir, @SW_HIDE)
WinWait("Refill CdKey")

this still does not work.

I am manipulating the window while it is off screen, yes.

and winwait does detect the title of the hidden window... at least it did on xp when i made this script using an earlier version of autoit 3

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

You didn't fix the problem!

You need to have this:

Run(@ScriptDir & "\cdkey.exe", @ScriptDir)

OR IT WON'T WORK!!! If you omit the @ScriptDir & "\ then it won't have the right path to the cdkey.exe. If you hide the window then it will never make WinWait return true!

And yes it will detect the TEXT of the window even if it is hidden. That is true. But WinWait has to have the window visible. I guess you could use WinExists for this if it has to be hidden.

Edited by JFee

Regards,Josh

Share this post


Link to post
Share on other sites

this is just sample code. perhaps there are a few typos.

opt("trayicondebug",1)
Run(@ScriptDir & "\cdkey.exe", @ScriptDir)
WinWait("Refill CdKey")

does not work


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

Works perfectly fine for me. Is cdkey.exe in the same directory as the script?


Regards,Josh

Share this post


Link to post
Share on other sites

Works perfectly fine for me. Is cdkey.exe in the same directory as the script?

yes.

the example i made earlier is this...

i made a seperate script, a simple one really. an infinite loop.

while 1
sleep(100)
wend

i compiled that script, named it "test" and i used this code in a script, and ran it.

opt("trayicondebug",1)
Run(@ScriptDir & "\test.exe", @ScriptDir)

the script ran test.exe

the script will not run cdkey.exe after changing "test" to "cdkey" appropriately.

on xp i had originally made the script, and yes, it worked for me too.

i am on a laptop now, with windows vista, and it does not work.


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

And yet you can run "cdkey.exe" directly from explorer with no problems? How about from the command lin or run box? Seems to me that it may be more of a Vista/rights/AntiVirus thing as opposed to an AutoIT thing

Share this post


Link to post
Share on other sites

Post a screenshot of the folder you are running the stuff from.


Regards,Josh

Share this post


Link to post
Share on other sites

#20 ·  Posted (edited)

"omg ..t0ddie on a roll again" is the only thing that comes to mind reading this thread....

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0