24 posts in this topic
What command would I use to open the following folder directories for:
Computer/This PC (windows 7/Windows 10)
Run("Explorer.exe " & $filepath) ShellExecute($filepath) can be used to open folder locations when you type in the full directory such as "C:\Users\%username%\Documents" but I'm trying to figure out how to use these windows short paths.
I'm attempting to code a Run or RunWait command that is a little on the long side and contains multiple sets of embedded quotes (as it would be issued from a CMD prompt), but can't for the life of me figure out the containing quotes as pertains to AutoIt. Here's the one-line command as it would be issued via a CMD prompt...
"\\AppServ\G$\Connectivity\Clients\Citrix\Receiver\126.96.36.19918\CitrixReceiver.exe" ADDLOCAL="ReceiverInside,ICA_Client,WebHelper,SSON,AM,SELFSERVICE,USB,DesktopViewer,Flash,Vd3d" ALLOWADDSTORE=A ALLOWSAVEPWD=A ENABLEPRELAUNCH=Y ENABLE_SSON=Yes STORE0="AppStore;https://receiver.domain.net/Citrix/Apps/discovery;on;AppStore" /EnableCEIP=false /includeSSON /noreboot /silent I've tried so many different combinations of surrounding quotes with Run and RunWait, I just don't understand why it's this difficult to get past this.
Can anyone assist with this?
This is probably an obvious one, but I really don't use this command at all so am hoping you can spot my mistake.
I'm running a powershell script on a schedule with the following script in a function, the function is being called in a loop, but the console process is not closing in the background and I end up with a bunch of console windows running in the background:
Run(@comspec & ' /k PowerShell.exe -STA -NonInteractive -ExecutionPolicy ByPass -Command "& ''Z:\Powershell\365\GetNextDetails.ps1'' "', "", @SW_HIDE) Thanks!
Hi all. I am creating an app that runs a program with the admin privileges using the shellexecute's run as verb, but what my problem is, that no matter what I use to launch the program, it doesn't quite work like the run dialog would (certain programs don't get found, etc.). I've tried using the explorer.exe and passing the program to it, that is unreliable and opens documents folder sometimes instead, I've tried using the @comspec /c and that works better, but still some of the programs aren't being found that would be with the run dialog e.g., if I do @comspec /c diskpart it won't find it, I've even tried setting the working dir, but still no luck. I also tried passing commandline params to C:\WINDOWS\system32\rundll32.exe shell32.dll,#61, but no luck. can anyone help me what way to go in order to be able to launch programs in the run dialog style? is there a function in winapi that run dialog uses that I could use as well? Or what would be the best way to go about this? Any help much appreciated.
I need help.
I have a project that outputs reports to PDF using @mLipok's lovely QuickPDF. The PDF is created with no problem and I am sure the problem is not there.
However, I then have to open the PDF so the user can see it.
I use (a) short file name and (b) object properties
$oQP.SetPageLayout(2) $oQP.SetPageMode(3) ... $sFilename ; as created by UDF Local $sShortname = FileGetShortname( sFilename , 1 ) Run( @ComSpec & " /c start /max " & sShortname, "", @SW_HIDE ) ; force default PDF reader to open PDF maximized Then the RUN should open it with the default application.
I have tested extensively on 32 bit Win7 and 64 bit Win10. Works.
However, 64 bit Win8 and another Win7 laptop gives a problem.
The problem is this: when (typically) Adobe Reader is ALREADY open, the PDF opens almost instantaneously. If the Reader is not open, it seems to stall. Never opens.
The host on which the report will be opened is unknown to me and the PDF reader can not be hard coded.
Right now, my only brutal, very un-stylish solution is to force the Reader open prior to the RUN command.
Any ideas or advice on what causes this or how it could be remedied would be greatly appreciated.