microbious Posted September 13, 2009 Posted September 13, 2009 (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 lineinstsrv.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 toRunWait(@ComSpec & '/k %TEMP%\instsrv.exe "FLEXnet Licensing Service" "%PROGRAMFILES%\Common Files\Macrovision Shared\FLEXnet Publisher\FNPLicensingService.exe"')I even tried giving it direct path asRunWait('"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 I see the window pops up and closes as if no commands were given to itmaybe there is another way to create service using autoit ? i just cant find anyThanks in advance Edited September 13, 2009 by Gettingsmarter
omikron48 Posted September 13, 2009 Posted September 13, 2009 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.
microbious Posted September 13, 2009 Author Posted September 13, 2009 (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 September 13, 2009 by Gettingsmarter
somdcomputerguy Posted September 13, 2009 Posted September 13, 2009 Maybe start=demand instead of start= demand? - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
DW1 Posted September 13, 2009 Posted September 13, 2009 (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 September 13, 2009 by danwilli AutoIt3 Online Help
microbious Posted September 13, 2009 Author Posted September 13, 2009 %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.
DW1 Posted September 13, 2009 Posted September 13, 2009 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"') AutoIt3 Online Help
microbious Posted September 13, 2009 Author Posted September 13, 2009 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
DW1 Posted September 13, 2009 Posted September 13, 2009 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. AutoIt3 Online Help
microbious Posted September 13, 2009 Author Posted September 13, 2009 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"
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now