Recently Browsing 0 members
No registered users viewing this page.
I am trying to pass multi-file selections from Windows Explorer into the $CmdLine argument parameters array. For example, and these are not the literal program/project names, I can pass three full path file names via both Window's Run dialog and Terminal into the $CmdLine array, i.e, "c:\Dir\Program.exe" "D:\Test\file1.txt" "D:\Test\file2.txt" "D:\Test\file3.txt". When checked in the running program, $CmdLine index  has the correct value of 3, index  is correct with "D:\Test\file1.txt", index  with "D:\Test\file2.txt" and index  with "D:\Test\file3.txt". I get the same correct results in $CmdLine array when I start Program.exe with the same three file parameters using the Windows Terminal.
Also, I have added a HKEY_CLASSES_ROOT\*\shell\command key to the Window's registry. The registry entry is with a "C:\Program.exe" "%1" "$2" "%3" string value to allow for renaming file(s) from Windows Explorer via the right-click menu. With just one parameter placeholder, "%1" in the string value, a selected file will appear in $CmdLine. $CmdLine is 1 and $Cmdline contains the selected full path file name. Unfortunately, when I change the registry string value to include two more passing arguments, "%2" "%3", $CmdLine =3 (as it should since three file path names are passed to Program.exe), $CmdLine contains "D:\Test\file1.txt", but $CmdLine and  are just empty strings.
It appears to me that Windows is not passing the second and third ("%2" and "%3") selected file's to Autoit, but just the first parameter "%1".
Is there some way that I can select more than one file in Window's Explorer and pass the full file paths into the $CmdLine array?
I know that AutoIt has the _WinAPI_GetOpenFileName function, but I would like to select files directly from Windows Explorer to bring into $CmdLine.
File Renaming Application 220.127.116.11.au3 Reg Key.reg
I am new to AutoIT although MANY years ago I used a similar program called WinBatch to automate morning routines.
I am having some issues running code from the command line.
If I use this line in my script
Run ('cmd.exe /K "C:\start microsoft-edge:https://app.flowalgo.com/users/login"') It opens the cmd screen but the directory is set to the directory where the script that is running is located.
C:\Autostart-Workstation\AMStart, and I need it to run from the C prompt
I can get it to open at the C prompt with
Run ('cmd.exe /K "cd\"') Is there a way to force the code to run from the root prompt ("C:\")?
or how do I send the code to the cmd screen once I've changed to the root drive
I have to run an executable with a parameter preceded by a /, like this:
I tried both this:
$iReturn = RunWait ("c:\myfolder\Tools\AutomaticRun\myexe.EXE"," /filename=c:\myfolder\Tools\AutomaticRun\myTemplate.xml")
and using COMSPEC as per some posted suggestions on this forum:
Run(@comspec & ' /c "c:\myfolder\Tools\AutomaticRun\myexe.EXE" /filename=c:\myfolder\Tools\AutomaticRun\myTemplate.xml')
They both seem to fail.
Can you please tell me what I'm doing wrong?
You guys helped me years ago to address logging in with a different account than the user. I have sense modified it over the years due to laptops syncing with AD which is why you will see 3 different passwords. So, this script snippet has worked for me in many things i have written but I am all the sudden having an issue getting it to work. I have verified that the password i am using for the local user account is $pass. Verified by doing a run as different user on Chrome and cut and pasted the password out of the script just to make sure i was not fat fingering something.
I get a fail back from RunAs every time.
Any chance you guys see something i am doing wrong?
#include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> ;#RequireAdmin If $CmdLine > 0 Then If $CmdLine = "/Install" Then RunUpdate() Exit EndIf ;;Will check users account to determine if admin, if not will Run with admin rights -------------------------------------------------------------- ;;Varables Start Local $user = ".\user" Local $pass = "password1" Local $pass2 = "password2" Local $pass3 = "password3" Local $filetorun = @ScriptFullPath & " /Install" ;;Varables End If IsAdmin () = 0 Then If RunAs ( $user, @CompterName, $pass, $RUN_LOGON_NOPROFILE,$filetorun) = 0 Then ;If RunAs ( $user, @ComputerName, $pass2, 0,$filetorun) = 0 Then ;If RunAs ( $user, @ComputerName, $pass3, 0,$filetorun) = 0 Then ;MsgBox (0,"Installation Error", "This installation was interrupted due to an incorrect Admin Password") ;Exit ;EndIf ;EndIf EndIf Exit Else Run ($filetorun) EndIf Func RunUpdate() MsgBox(0,"worked","worked") EndFunc
Hey I'm writing on a script which places a link in the context menu so you can choose several mp3 files and rename them using id3 tag udf and year / time stuff variables.
My problem: I'm renaming the files through "FileMove", But HOW can I get the current directory of the chosen files only? I can't use stringsplit cz there are more than 1 delimiter "\". and I can't trim the string because the stringlength changes every time. How can I get ONLY the directory where the files from $cmdline chosen are?