galvatec Posted July 25, 2019 Share Posted July 25, 2019 So I created this script, but when running it nothing happens. what did I do wrong? This my script: #include <AutoItConstants.au3> vms() Func vms() ; Change the username and password to the appropriate values for your system. Local $sUserName = "user" Local $sPassword = "password" Local $iPID = RunAs($sUserName, @ComputerName, $sPassword, $RUN_LOGON_PROFILE,"C:\Program Files\iVMS-4200 Station\iVMS-4200\iVMS-4200 Client\iVMS-4200.exe"," ", @SW_SHOWMAXIMIZED) EndFunc ;==>vms Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted July 26, 2019 Share Posted July 26, 2019 (edited) Hi @galvatec, and welcome to the AutoIt forums Did you check the following in the Help file? Quote Remarks Paths with spaces need to be enclosed in quotation marks. It is important to specify a working directory the user you are running as has access to, otherwise the function will fail. Try to enclose your file path in quotation marks, and try it again P.S.: Use the standard font and use the <> Code Tag to post some code in your thread; that will make the post more readable Edited July 26, 2019 by FrancescoDiMuro Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Developers Jos Posted July 26, 2019 Developers Share Posted July 26, 2019 Guess this needs to run in x64 mode...so are you doing that? What is the returncode and @error from the run? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
galvatec Posted July 26, 2019 Author Share Posted July 26, 2019 Many thanks for the reply. @FrancescoDiMuro I wasn't sure about the quotes on the way with spaces, so I redid the way it is in the code below, please let me know if this is correct as it hasn't worked yet. I set the working directory using the directory we use here in the company that is 😄 \ Support is it correct to put the work directory in this way in the code? Regarding the source for posting the code I used the AutoIT font because I copied the text there, can you change the font? Please forgive me my ignorance I am new to the forum and AutoIT. @Jos Regarding running on x64 I don't know how to do that, could you show me? < Local $ IPID = RunAs ($ sUserName, @ComputerName, $ sPassword, $ RUN_LOGON_PROFILE, "C: \ Program" "Files \ iVMS-4200" "Estação \ iVMS-4200 \ iVMS-4200" "Client \ iVMS-4200. exe "," 😄 \ Suporte ", @SW_SHOWMAXIMIZED) > Link to comment Share on other sites More sharing options...
Developers Jos Posted July 26, 2019 Developers Share Posted July 26, 2019 28 minutes ago, galvatec said: I don't know how to do that, could you show me? Did you check the helpfile? ...guess not! Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
galvatec Posted July 26, 2019 Author Share Posted July 26, 2019 @Jos Yes I already searched with must be defined the working directory but not found. Link to comment Share on other sites More sharing options...
Developers Jos Posted July 26, 2019 Developers Share Posted July 26, 2019 No idea what you are telling me: Your question was about x64 and now you talk about Working directory? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
galvatec Posted July 26, 2019 Author Share Posted July 26, 2019 @Jos I'm sorry I got confused !! About x64 I will search. Link to comment Share on other sites More sharing options...
galvatec Posted July 26, 2019 Author Share Posted July 26, 2019 I am confused because this script works, even without changing as x64 settings < #include <AutoItConstants.au3> RunAs("alfreire", @ComputerName, "28437620", $RUN_LOGON_PROFILE,'"C:\Program Files (x86)\teraterm\ttermpro.exe"',"", @SW_SHOWMAXIMIZED) > However this script does not work and not the error message. < #include <AutoItConstants.au3> RunAs("alfreire", @ComputerName, "28437620", $RUN_LOGON_PROFILE,'"C:\Program Files (x86)\iVMS-4200 Station\iVMS-4200\iVMS-4200 Client\iVMS-4200.exe"',"", @SW_SHOWMAXIMIZED) > Link to comment Share on other sites More sharing options...
galvatec Posted July 26, 2019 Author Share Posted July 26, 2019 Estou confuso porque esse script funciona, mesmo sem alterar as configurações do x64 < #include <AutoItConstants.au3> RunAs ("alférire", @Nome_do_Computador, "28437620", $ RUN_LOGON_PROFILE, '"C: \ Arquivos de Programas (x86) \ teraterm \ ttermpro.exe"', "", @SW_SHOWMAXIMIZED) > No entanto, este script não funciona e não a mensagem de erro. < #include <AutoItConstants.au3> RunAs ("alférire", @Nome do Computador, "28437620", $ RUN_LOGON_PROFILE, '"C: \ Arquivos de Programas (x86) \ iVMS-4200 Estação \ iVMS-4200 \ iVMS-4200 Client \ iVMS -4200.exe "'," ", @SW_SHOWMAXIMIZED) > Link to comment Share on other sites More sharing options...
Developers Jos Posted July 26, 2019 Developers Share Posted July 26, 2019 Moved to the appropriate forum. Moderation Team SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Developers Jos Posted July 26, 2019 Developers Share Posted July 26, 2019 This is an English forum, so please usethat Thanks Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Developers Jos Posted July 26, 2019 Developers Share Posted July 26, 2019 (edited) Please stick to one thread and one version of the script ! Merged and let this be the last intervention as I get tired of having to clean up stuff. Jos Edited July 26, 2019 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
galvatec Posted July 26, 2019 Author Share Posted July 26, 2019 @Jos I would like to know if it is possible for me to remove this topic as it is not helping me at all. If you can, please remove this topic. Link to comment Share on other sites More sharing options...
Developers Jos Posted July 26, 2019 Developers Share Posted July 26, 2019 We don't t remove topics. Just bring it back on track, as you derailed it, by asking what it is you really want to know. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
galvatec Posted July 26, 2019 Author Share Posted July 26, 2019 I'm confused because this script works even without changing x64 settings < #include <AutoItConstants.au3> RunAs ("alfreire", @ComputerName, "28437620", $ RUN_LOGON_PROFILE, "" 😄 \ Program Files (x86) \ teraterm \ ttermpro.exe "'," "@SW_SHOWMAXIMIZED) > However, this script does not work and not the error message. < #include <AutoItConstants.au3> RunAs ("alfireire", @Computer Name, "28437620", $ RUN_LOGON_PROFILE, '"C: \ Program Files (x86) \ iVMS-4200 Station \ iVMS-4200 \ iVMS-4200 Client \ iVMS -4200.exe" ', "" @SW_SHOWMAXIMIZED) > I need to know why the second script doesn't work, it conforms to what is shown in the help file and doesn't work. Link to comment Share on other sites More sharing options...
Developers Jos Posted July 26, 2019 Developers Share Posted July 26, 2019 23 minutes ago, galvatec said: #include <AutoItConstants.au3> RunAs ("alfireire", @Computer Name, "28437620", $ RUN_LOGON_PROFILE, '"C: \ Program Files (x86) \ iVMS-4200 Station \ iVMS-4200 \ iVMS-4200 Client \ iVMS -4200.exe" ', "" @SW_SHOWMAXIMIZED) This will never work as it contains a syntax error and it has spaces all over the place, so what is the exact fully qualified path+filename for the exe? Something like this should be closer to what you need, but update the path so it is correct: #include <AutoItConstants.au3> RunAs ("alfireire", @ComputerName, "28437620", $ RUN_LOGON_PROFILE, "C:\Program Files (x86)\iVMS-4200 Station\iVMS-4200\iVMS-4200 Client\iVMS-4200.exe", "C:\Program Files (x86)\iVMS-4200 Station\iVMS-4200\iVMS-4200 Client", @SW_SHOWMAXIMIZED) Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
galvatec Posted July 26, 2019 Author Share Posted July 26, 2019 #include <AutoItConstants.au3> RunAs("alfreire", @ComputerName, "28437620", $RUN_LOGON_PROFILE,'"C:\Program Files (x86)\teraterm\ttermpro.exe"',"", @SW_SHOWMAXIMIZED) If spaces are a problem why does this script work? That is what I do not understand. Link to comment Share on other sites More sharing options...
Developers Jos Posted July 26, 2019 Developers Share Posted July 26, 2019 Just answer my question: 15 minutes ago, Jos said: so what is the exact fully qualified path+filename for the exe? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
galvatec Posted July 26, 2019 Author Share Posted July 26, 2019 #include <AutoItConstants.au3> RunAs ("alfreire", @ComputerName, "28437620", $RUN_LOGON_PROFILE, '"C:\Program Files (x86)\iVMS-4200 Station\iVMS-4200\iVMS-4200 Client\iVMS-4200.exe"',"", @SW_SHOWMAXIMIZED) But this is the way that is in the code : C:\Program Files (x86)\iVMS-4200 Station\iVMS-4200\iVMS-4200 Client\iVMS-4200.exe Link to comment Share on other sites More sharing options...
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