nickston Posted July 5, 2016 Posted July 5, 2016 I've string "\l\jvncviewer.jar". Check that string with fileexists("\l\jvncviewer.jar") and file is exsists. Then ShellExecute("\l\jvncviewer.jar") and rise window with message "can't find \l\jvncviewer.jar " How thats fix.
MattHiggs Posted July 5, 2016 Posted July 5, 2016 I would also try using the full path to the file. See if full path works. Even if you assume that the directory the script is in is the working location, you can still use "@scriptDir" to include the full path to the working directory.
nickston Posted July 6, 2016 Author Posted July 6, 2016 To Synapse. At other PC my code is work. And my code have used many others Paths, therefore I cant use solution in the link. To MattHiggs, if before path insert disk letter (use full path) then all work. But how I can detect what somthing wrong? if for this I use fileexists. Fileexists say me what all ok, and I try shellexecute.
SadBunny Posted July 6, 2016 Posted July 6, 2016 Your topic title indicates a problem with FileExists, but you say that FileExists works. Maybe update your topic title. I would also suggest trying the full path to the file. It is very likely that your working dir (debug by checking @WorkingDir) is not on the same drive as your "\l\jvncviewer.jar". Also, these things: Does your FileExists test actually look for the exact same path as your ShellExecute? If so, could it be that your script changes its working directory somewhere between the two commands? I wrote this as a reproducer: $file = "\tmp\hi.bat" ConsoleWrite("Working dir: '" & @WorkingDir & "'" & @CRLF) ConsoleWrite("File '" & $file & "' exists? " & FileExists($file) & @CRLF) ShellExecute("\tmp\hi.bat") My personal working directory is f:\dev\AutoIt3. If I create a batchfile c:\tmp\hi.bat then the FileExists returns 0 and the ShellExecute fails, but if I create a batchfile c:\tmp\hi.bat then FileExists returns 1 and the ShellExecute works. Maybe you could write a reproducer? Chances are it will indicate your problem. Roses are FF0000, violets are 0000FF... All my base are belong to you.
nickston Posted July 7, 2016 Author Posted July 7, 2016 A bit wrong. fileexists find file if the path with drive letter or without. I dont now its rigth or no. but if path without drive letter and fileexists find file why shellexecute cant find same file ( or find on other pc). And from here I see three ways: 1) problem with fileexists 2) problem with shellexecute 3) problem with windows settings. Idea about workingdir I think good idea. I'll check it.
nickston Posted July 8, 2016 Author Posted July 8, 2016 In the first post, I have missed part of code. it was: ShellExecute("\l\jvncviewer.jar") but must be: ShellExecute("\l\jvncviewer.jar",'',"\l\"). Now I have tried ShellExecute("\l\jvncviewer.jar"), without workingdir and it works. All thanks. but why fileexists finds file, and shellexecute doesn't find?
SadBunny Posted July 8, 2016 Posted July 8, 2016 So shellexecute works without that workingdir and not with the working dir? Hmmz... Could you post a screenshot of your error? Roses are FF0000, violets are 0000FF... All my base are belong to you.
nickston Posted July 9, 2016 Author Posted July 9, 2016 At one PC shellexecute work with workingdir and without, at other work only without.
SadBunny Posted July 9, 2016 Posted July 9, 2016 Too bad I can't read it. If I try shellexecute to a non-working network path, I get "Windows cannot find <filename>. Make sure you've typed the name correctly, then try again.", so your message is suspiciously verbose Well if your script works on one computer but not on the other, and only uses these quite common instructions, it is highly unlikely that autoit is broken or something. It's almost certainly something with your setup. Could it be that the user you are using to run that jar is one that has rights to read but not to execute? Roses are FF0000, violets are 0000FF... All my base are belong to you.
nickston Posted July 9, 2016 Author Posted July 9, 2016 If in path insert drive letter shellexecute will execute jar. Thats way script have right to read and execute
SadBunny Posted July 9, 2016 Posted July 9, 2016 Right... Well, I'm afraid I have to give up, I have no idea. Sorry... Roses are FF0000, violets are 0000FF... All my base are belong to you.
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