Sign in to follow this  
Followers 0
microbious

Why this doesnt work ?

10 posts in this topic

#1 ·  Posted (edited)

Can you guys tell me why this doesnt work ?

FileInstall ("instsrv.exe",@TempDir & "\instsrv.exe",1)
RunWait(@TempDir & '\instsrv.exe "FLEXnet Licensing Service" "%PROGRAMFILES%\Common Files\Macrovision Shared\FLEXnet Publisher\FNPLicensingService.exe"')
RunWait(@ComSpec & ' /c sc config "Autodesk Licensing Service" start= demand',"")

instsrv.exe is in temp folder and using batch.bat file with the following line

instsrv.exe "FLEXnet Licensing Service" "%PROGRAMFILES%\Common Files\Macrovision Shared\FLEXnet Publisher\FNPLicensingService.exe"

would create service named "FLEXnet Licensing Service" using EXE located in "%PROGRAMFILES%\Common Files\Macrovision Shared\FLEXnet Publisher\FNPLicensingService.exe"

what am i doing wrong ?

I tried to

RunWait(@ComSpec & '/k %TEMP%\instsrv.exe "FLEXnet Licensing Service" "%PROGRAMFILES%\Common Files\Macrovision Shared\FLEXnet Publisher\FNPLicensingService.exe"')

I even tried giving it direct path as

RunWait('"C:\Documents and Settings\Administrator\Local Settings\Temp\instsrv.exe" "FLEXnet Licensing Service" "%PROGRAMFILES%\Common Files\Macrovision Shared\FLEXnet Publisher\FNPLicensingService.exe"')

still nothing. Service is not created :D

I see the window pops up and closes as if no commands were given to it

maybe there is another way to create service using autoit ? i just cant find any

Thanks in advance

Edited by Gettingsmarter

Share this post


Link to post
Share on other sites



DOS doesn't like paths with spaces in between. You need to use quotes on paths with spaces.

Either: "C:\Program Files\" or C:\"Program Files"\

Your problem is with DOS, not AutoIt.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

i have all quotes required.

In fact command was copy/paste from file.bat that works just fine

how is this missing any quotes ?

RunWait(@TempDir & '\instsrv.exe "FLEXnet Licensing Service" "%PROGRAMFILES%\Common Files\Macrovision Shared\FLEXnet Publisher\FNPLicensingService.exe"')

pretty sure they are all there

Edited by Gettingsmarter

Share this post


Link to post
Share on other sites

Maybe start=demand instead of start= demand?


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

%PROGRAMFILES% is a batch variable that isn't going to expand in autoit. In autoit you would use @ProgramFilesDir.

So try this out:

RunWait(@TempDir & '\instsrv.exe "FLEXnet Licensing Service" "' & @ProgramFilesDir & '\Common Files\Macrovision Shared\FLEXnet Publisher\FNPLicensingService.exe"')
Edited by danwilli

Share this post


Link to post
Share on other sites

%PROGRAMFILES% is a batch variable that isn't going to expand in autoit. In autoit you would use @ProgramFilesDir.

So try this out:

RunWait(@TempDir & '\instsrv.exe "FLEXnet Licensing Service" "' & @ProgramFilesDir & '\Common Files\Macrovision Shared\FLEXnet Publisher\FNPLicensingService.exe"')

i understand that %programfiles% is not autoit environment variable, but this command is not executed toward autoit, its executed toward instsrv.exe and instsrv.exe understands it.

Also Start=Demand is not gonna fix or effect anything.

Share this post


Link to post
Share on other sites

i understand that %programfiles% is not autoit environment variable, but this command is not executed toward autoit, its executed toward instsrv.exe and instsrv.exe understands it.

Also Start=Demand is not gonna fix or effect anything.

You said you took this from a batch file... If that is the case, then %programfiles% was expanded before it was passed as a parameter. I don't think you are supposed to pass %programfiles% and I do not think that the instsrv executable will process it. This only works from a command prompt(batch).

This doesn't work?

ShellExecuteWait(@TempDir & '\instsrv.exe', '"FLEXnet Licensing Service" "' & @ProgramFilesDir & '\Common Files\Macrovision Shared\FLEXnet Publisher\FNPLicensingService.exe"')

Share this post


Link to post
Share on other sites

You said you took this from a batch file... If that is the case, then %programfiles% was expanded before it was passed as a parameter. I don't think you are supposed to pass %programfiles% and I do not think that the instsrv executable will process it. This only works from a command prompt(batch).

This doesn't work?

ShellExecuteWait(@TempDir & '\instsrv.exe', '"FLEXnet Licensing Service" "' & @ProgramFilesDir & '\Common Files\Macrovision Shared\FLEXnet Publisher\FNPLicensingService.exe"')

Thanks ill try that

I also found that this works

RunWait(@ComSpec & ' /k %TEMP%\instsrv.exe "FLEXnet Licensing Service" "%PROGRAMFILES%\Common Files\Macrovision Shared\FLEXnet Publisher\FNPLicensingService.exe"')

thank u guys

Share this post


Link to post
Share on other sites

yep @comspec is just cmd.exe, so it is being expanded before being passed (same as batch, because well, any command passed to cmd.exe is batch), but you see what I mean for the RunWait you were using.

Glad it's working.

Share this post


Link to post
Share on other sites

yep @comspec is just cmd.exe, so it is being expanded before being passed (same as batch, because well, any command passed to cmd.exe is batch), but you see what I mean for the RunWait you were using.

Glad it's working.

yep all thanks to you and my "NEVER GIVE UP" :D

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