Jump to content

Recommended Posts

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
Posted

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.

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
Posted

%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.

Posted

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"')
Posted

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

Posted

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.

Posted

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

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
  • Recently Browsing   0 members

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