Jump to content

Gringo

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by Gringo

  1. Thank you very much indeed Works like a charm
  2. Hi and thank you for your answers, If I only use $path I create a shortcut to the exe file choosen but the purpose of the litle program is to make a shortcut for an exe that will be executed in high priority. The program that I'm trying to do should work like this : 1 The user choose and exe and it's stored to the variable "path" (for instance "F:\test\test.exe") 2 the path and target are concatened to give the result : c:\windows\System32\cmd.exe /c start "runhigh" /high "F:\test\test.exe" 3 the shortcut is created on the desktop to c:\windows\System32\cmd.exe /c start "runhigh" /high "F:\test\test.exe" So everytime a user need to launch a program in high priority he can launch the shortcut instead of launching the program and set the priority in task manager. The two problem are: -The concatenation of the 2 variable is not working if I do a shellexecute of target I got an error saying windows cannot find the target -the shortcut is created but the line isn't in the right place if you do a property of the created shortcut I've figured out that I missed some quote in the path c:\windows\System32\cmd.exe /c start "runhigh" /high F:\test\test.exe that shoud be c:\windows\System32\cmd.exe /c start "runhigh" /high "F:\test\test.exe" so I managed to add it $path2 = '"' & $path & '"' $target = $elev & $path2 so now if I do an shellexecute it doesn't work buf if I create a batch file it does. FileWriteLine ("c:\prior\path.bat", $target) The batch solution is complicated because I have to take the path variable "F:\test\test.exe" to take to remove the path of the exe file and have something like "F:\test\" then set it as working dir then do a shortcut of that batch to the desktop. But I'm prety sure the direct shortcut way could work, and it's more elegant.
  3. Hi, I'm trying to create a shortcut playing with variables but I can't figure out what's wrong I got 2 variables joined in one with for instance Local $path = FileOpenDialog($message, "C:" & "", "Select your executable (*.exe)", 1 + 4) Local $elev = 'c:\windows\System32\cmd.exe /c start "runhigh" /high ' $target = $elev & $path FileCreateShortcut($target, @DesktopCommonDir & "\linked.lnk", StringLeft($target,StringInStr($target,"\",0,-1)) , "" , "" , "c:\i.ico") The problem is that a shortcut is created but instead of the target area I got the start in filled with my variable My second problem is that when I do a shell execute of the result of $target = $elev & $path, Note that if I do a batch with the variable written manually, it's working.
  4. Thank you very much again, It says that the folder is copied exept it doesn't, maybe It's a bug with dircopy I tried to compile it and run it as administrator with no success. Maybe I can try to do the same thing runing a command like xcopy guideone "F:\Jeux\Steam\SteamApps\common\Fallout 4\guideone" /s /y /I but passing the destination dir as variable something like #include <MsgBoxConstants.au3> $dircp = IniRead("path.ini", "Path", "path", " ERROR") Run(@ComSpec & " /c " & "xcopy ", & "guideone " &$dircp & " /s" " /y" " /I", "", @SW_HIDE) I'll test that, what do you think?
  5. Thank you for your answer, I'll try that but the synthax with the & $dircp seems correct right?
  6. Hi, I'd like to do simple copy of a directory reading an ini for the path. I'm pretty sure it's not a big deal but for a noob like me... Well I'm looking for a solution since 2 hours now #include <MsgBoxConstants.au3> $dircp = IniRead("path.ini", "Path", "path", " ERROR") MsgBox($MB_SYSTEMMODAL, "", "path is: : " & $dircp) DirCopy ("Guideone", $dircp) The value returned by iniread is correct, but the dircopy does nothing, Any idea?
  7. Hi, I'm trying to: -Select a file in a folder (to store it to an ini file) -Write the file on an ini -Copy files to the folder selected by the user instead of using FileOpenDialog then FileSelectFolder, I was wondering if it was possible to do the whole thing only with FileOpenDialog spliting the value returned in 2 variables. I got something like that for the first part (select a file and store it to an ini file) Local $message = "Select your executable" Local $pathk = FileOpenDialog($message, "C:" & "", "Select the executable you want to terminate (*.exe)", 1 + 4) Local $path = "None" ;ici je dois copier les fichiers $split = StringSplit($pathk, "\") $tokill = $split[$split[0]] If @error Then MsgBox(4096, "", "No Executable chosen") Else MsgBox(4096, "", $pathk & " Will be terminated " & @LF & @LF & "Press OK to EXIT ") IniWrite(@ScriptDir & "\path.ini", "Torun", "path", $path) IniWrite(@ScriptDir & "\path.ini", "Tokill", "pathk", $tokill) EndIf As you can see I manage to split the value returned by FileOpenDialog to have only the exe but as a noob I can't manage to get the path to copy the files I need to the same path. Any idea? ^^
×
×
  • Create New...