Jump to content

Why this doesnt work ?


microbious
 Share

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
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"')
Edited by danwilli
Link to comment
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.

Link to comment
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"')
Link to comment
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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...