Sign in to follow this  
Followers 0
AntonioGNAL

Impossible to run a reg export

9 posts in this topic

#1 ·  Posted (edited)

Hi guys,

I've been trying to create a registry key export for a while, but i'm hitting my head against a wall here.

I've tried a huge amount of combinations for both:

ShellExecuteWait & RunWait commands, but they never complete the task.

;This is the reg key
Global $targetHistory = "HKEY_CURRENT_USER\Software\Hewlett-Packard\HP Print Settings\Ubicación predeterminada\Target History"

RegeditTH($logHandler, $regBackup, $targetHistory)

Func RegeditTH($logHandler, $regBackup, $targetHistory)
   Local $THRegBkup = $regBackup & "ExportTH.bat"
   Local $THRegHandler
   Local $removeFile

   _FileWriteLog($logHandler, "INFORMATION: ExportTH.bat storage directory = " & $regBackup & "." & @CRLF)

   ; Create a file to write registry keys to.
   If Not _FileCreate($THRegBkup) Then
      ; Error flags:
      ; 1 - Error opening specified file
      ; 2 - File could not be written to
      ; [OPTIONAL] Display a pop-up message for notification, error creating the file
      ;MsgBox($MB_SYSTEMMODAL, "Error", " Error reating reg file. Error Code:" & @error & ".")
      _FileWriteLog($logHandler, "WARNING: Registry export file not created." & @CRLF)
   Else
      $THRegHandler = FileOpen ($THRegBkup ,$FO_APPEND)
      If $THRegHandler <> -1 Then
         _FileWriteLog($logHandler, "INFORMATION: Performing registry backup for Target History keys." & @CRLF)
         FileWrite($THRegHandler, "@echo off" & @CRLF)
         ;FileWrite($THRegHandler, "regedit.exe /e " & $regBackup & "TargetHistory.reg " & '"HKEY_CURRENT_USER\Software\Hewlett-Packard\HP Print Settings\Ubicación predeterminada\Target History"' & @CRLF)
         FileWrite($THRegHandler, "Reg export " & '"HKEY_CURRENT_USER\Software\Hewlett-Packard\HP Print Settings\Ubicación predeterminada\Target History" ' & $regBackup & "TargetHistory.reg " & "/y" & @CRLF)
         FileWrite($THRegHandler, "dir " & $regBackup & @CRLF)
         FileWrite($THRegHandler, "dir " & $regBackup & " >> " & $regBackup & "dir.txt" & @CRLF)
         FileWrite($THRegHandler, "pause" & @CRLF)
         FileWrite($THRegHandler, "exit /B" & @CRLF)
         FileWrite($THRegHandler, "exit" & @CRLF)
         FileClose($THRegHandler)
         ;RunWait(@ComSpec & " /k " & "regedit.exe /e " & $regBackup & "TargetHistory2.reg " & $targetHistory)
         ;ShellExecuteWait(@ComSpec , "/k regedit.exe /e " & $regBackup & "TargetHistory.reg " & $targetHistory)
         ;ShellExecuteWait(@ComSpec & " /c " & $THRegBkup, @SW_HIDE)
         RunWait(@ComSpec & " /c " & $THRegBkup)
         ; Error Flag is set to non-zero in case of failure
         If @error <> 0 Then _FileWriteLog($logHandler, "ERROR: Registry export failed." & @CRLF)
      Else
         _FileWriteLog($logHandler, "WARNING: ExportTH.bat file could not be opened." & @CRLF)
      EndIf
      $removeFile = FileDelete($THRegBkup)
      If $removeFile Then
         _FileWriteLog($logHandler, "INFORMATION: File " & $THRegBkup & " deleted."
      Else
         _FileWriteLog($logHandler, "WARNING: File " & $THRegBkup & " not deleted or it does not exist."
      EndIf
   EndIf

   ; Close the handle returned by FileOpen.
   FileClose($THRegHandler)
EndFunc

This is the function i'm using for the call.

Since i was not going anywhere with the AutoIt direct executions, i even tried creating a bat/cmd file with the command for a reg export to create the reg file i needed. However, even running the bat file is not working for me. I mean, the bat is executed, as you can see i created a couple of "dir" commands to be prompted and sent to a file. And they are showing up, but the registry export is never being executed.

The best i could get was a message saying it was impossible to locate the key, but i know with 100% certainty the key exists in that path (because i'm creating and deleting it all the time).

Can anyone point out any possible mistakes?

Here you can see the error message in the CMD prompt:

Execution_001_zps76e6049b.png

Thanks!

Edited by AntonioGNAL

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

;modified little bit... try this

 

 
;This is the reg key

#include <File.au3>
 
Global $targetHistory = "HKEY_CURRENT_USER\Software\Hewlett-Packard\HP Print Settings\Ubicación predeterminada\Target History"
Global $logHandler
Global $regBackup
 
 
RegeditTH($logHandler, $regBackup, $targetHistory)
 
 
 
Func RegeditTH($logHandler, $regBackup, $targetHistory)
 
   Local $THRegBkup = $regBackup & "ExportTH.bat"
 
   Local $THRegHandler
 
   Local $removeFile
 
 
 
   _FileWriteLog($logHandler, "INFORMATION: ExportTH.bat storage directory = " & $regBackup & "." & @CRLF)
 
 
 
   ; Create a file to write registry keys to.
 
   If Not _FileCreate($THRegBkup) Then
 
      ; Error flags:
 
      ; 1 - Error opening specified file
 
      ; 2 - File could not be written to
 
      ; [OPTIONAL] Display a pop-up message for notification, error creating the file
 
      ;MsgBox($MB_SYSTEMMODAL, "Error", " Error reating reg file. Error Code:" & @error & ".")
 
      _FileWriteLog($logHandler, "WARNING: Registry export file not created." & @CRLF)
 
   Else
 
      $THRegHandler = FileOpen ($THRegBkup ,$FO_APPEND)
 
      If $THRegHandler <> -1 Then
 
         _FileWriteLog($logHandler, "INFORMATION: Performing registry backup for Target History keys." & @CRLF)
 
         FileWrite($THRegHandler, "@echo off" & @CRLF)
 
         ;FileWrite($THRegHandler, "regedit.exe /e " & $regBackup & "TargetHistory.reg " & '"HKEY_CURRENT_USER\Software\Hewlett-Packard\HP Print Settings\Ubicación predeterminada\Target History"' & @CRLF)
 
         FileWrite($THRegHandler, "Reg export " & '"HKEY_CURRENT_USER\Software\Hewlett-Packard\HP Print Settings\Ubicación predeterminada\Target History" ' & $regBackup & "TargetHistory.reg " & "/y" & @CRLF)
 
         FileWrite($THRegHandler, "dir " & $regBackup & @CRLF)
 
         FileWrite($THRegHandler, "dir " & $regBackup & " >> " & $regBackup & "dir.txt" & @CRLF)
 
         FileWrite($THRegHandler, "pause" & @CRLF)
 
         FileWrite($THRegHandler, "exit /B" & @CRLF)
 
         FileWrite($THRegHandler, "exit" & @CRLF)
 
         FileClose($THRegHandler)
 
         ;RunWait(@ComSpec & " /k " & "regedit.exe /e " & $regBackup & "TargetHistory2.reg " & $targetHistory)
 
         ;ShellExecuteWait(@ComSpec , "/k regedit.exe /e " & $regBackup & "TargetHistory.reg " & $targetHistory)
 
         ;ShellExecuteWait(@ComSpec & " /c " & $THRegBkup, @SW_HIDE)
 
         RunWait(@ComSpec & " /c " & $THRegBkup)
 
         ; Error Flag is set to non-zero in case of failure
 
         If @error <> 0 Then _FileWriteLog($logHandler, "ERROR: Registry export failed." & @CRLF)
 
      Else
 
         _FileWriteLog($logHandler, "WARNING: ExportTH.bat file could not be opened." & @CRLF)
 
      EndIf
 
      $removeFile = FileDelete($THRegBkup)
 
      If $removeFile Then
 
         _FileWriteLog($logHandler, "INFORMATION: File " & $THRegBkup & " deleted."
 
      Else
 
         _FileWriteLog($logHandler, "WARNING: File " & $THRegBkup & " not deleted or it does not exist."
 
      EndIf
 
   EndIf
 
 
 
   ; Close the handle returned by FileOpen.
 
   FileClose($THRegHandler)
 
EndFunc
Edited by Melba23
Added code tags

Share this post


Link to post
Share on other sites

Paramjeet,

Welcome to the AutoIt forum. :)

When you post code please use Code tags - see here how to do it. Then you get a scrolling box and syntax colouring as you can see above now I have added the tags. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Sure

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

;modified little bit... try this

 

 
;This is the reg key

#include <File.au3>
 
Global $targetHistory = "HKEY_CURRENT_USER\Software\Hewlett-Packard\HP Print Settings\Ubicación predeterminada\Target History"
Global $logHandler
Global $regBackup
 
 
RegeditTH($logHandler, $regBackup, $targetHistory)
 
 
 
Func RegeditTH($logHandler, $regBackup, $targetHistory)
 
   Local $THRegBkup = $regBackup & "ExportTH.bat"
 
   Local $THRegHandler
 
   Local $removeFile
 
 
 
   _FileWriteLog($logHandler, "INFORMATION: ExportTH.bat storage directory = " & $regBackup & "." & @CRLF)
 
 
 
   ; Create a file to write registry keys to.
 
   If Not _FileCreate($THRegBkup) Then
 
      ; Error flags:
 
      ; 1 - Error opening specified file
 
      ; 2 - File could not be written to
 
      ; [OPTIONAL] Display a pop-up message for notification, error creating the file
 
      ;MsgBox($MB_SYSTEMMODAL, "Error", " Error reating reg file. Error Code:" & @error & ".")
 
      _FileWriteLog($logHandler, "WARNING: Registry export file not created." & @CRLF)
 
   Else
 
      $THRegHandler = FileOpen ($THRegBkup ,$FO_APPEND)
 
      If $THRegHandler <> -1 Then
 
         _FileWriteLog($logHandler, "INFORMATION: Performing registry backup for Target History keys." & @CRLF)
 
         FileWrite($THRegHandler, "@echo off" & @CRLF)
 
         ;FileWrite($THRegHandler, "regedit.exe /e " & $regBackup & "TargetHistory.reg " & '"HKEY_CURRENT_USER\Software\Hewlett-Packard\HP Print Settings\Ubicación predeterminada\Target History"' & @CRLF)
 
         FileWrite($THRegHandler, "Reg export " & '"HKEY_CURRENT_USER\Software\Hewlett-Packard\HP Print Settings\Ubicación predeterminada\Target History" ' & $regBackup & "TargetHistory.reg " & "/y" & @CRLF)
 
         FileWrite($THRegHandler, "dir " & $regBackup & @CRLF)
 
         FileWrite($THRegHandler, "dir " & $regBackup & " >> " & $regBackup & "dir.txt" & @CRLF)
 
         FileWrite($THRegHandler, "pause" & @CRLF)
 
         FileWrite($THRegHandler, "exit /B" & @CRLF)
 
         FileWrite($THRegHandler, "exit" & @CRLF)
 
         FileClose($THRegHandler)
 
         ;RunWait(@ComSpec & " /k " & "regedit.exe /e " & $regBackup & "TargetHistory2.reg " & $targetHistory)
 
         ;ShellExecuteWait(@ComSpec , "/k regedit.exe /e " & $regBackup & "TargetHistory.reg " & $targetHistory)
 
         ;ShellExecuteWait(@ComSpec & " /c " & $THRegBkup, @SW_HIDE)
 
         RunWait(@ComSpec & " /c " & $THRegBkup)
 
         ; Error Flag is set to non-zero in case of failure
 
         If @error <> 0 Then _FileWriteLog($logHandler, "ERROR: Registry export failed." & @CRLF)
 
      Else
 
         _FileWriteLog($logHandler, "WARNING: ExportTH.bat file could not be opened." & @CRLF)
 
      EndIf
 
      $removeFile = FileDelete($THRegBkup)
 
      If $removeFile Then
 
         _FileWriteLog($logHandler, "INFORMATION: File " & $THRegBkup & " deleted."
 
      Else
 
         _FileWriteLog($logHandler, "WARNING: File " & $THRegBkup & " not deleted or it does not exist."
 
      EndIf
 
   EndIf
 
 
 
   ; Close the handle returned by FileOpen.
 
   FileClose($THRegHandler)
 
EndFunc

Hi Paramjeet,

Thanks for your answer.

I already have the includes and other variables in the code, i just didn't write everything because it would take too much space.

I did something i was afraid might work and it did... instead of exporting the key:

HKEY_CURRENT_USERSoftwareHewlett-PackardHP Print SettingsUbicación predeterminadaTarget History

I exported the key:

HKEY_CURRENT_USERSoftwareHewlett-PackardHP Print Settings

And the reg file automatically appeared when i executed the program. So there's something wrong with that key name which i'm unable to find.

I also have an issue here:

Local $removeFile
$removeFile = FileDelete($THRegBkup)
If $removeFile Then
   _FileWriteLog($logHandler, "INFORMATION: File " & $THRegBkup & " deleted."
Else
   _FileWriteLog($logHandler, "WARNING: File " & $THRegBkup & " not deleted or it does not exist."
EndIf

I don't know why, but i get this error:

Execution_002_zps2027aac6.png

It's strange because in the function description i saw a really similar code:

; Delete the temporary file.
    Local $iDelete = FileDelete($sFilePath)

    ; Display a message of whether the file was deleted.
    If $iDelete Then
        MsgBox($MB_SYSTEMMODAL, "", "The file was successfuly deleted.")
    Else
        MsgBox($MB_SYSTEMMODAL, "", "An error occurred whilst deleting the file.")
    EndIf

Any ideas?

Edited by AntonioGNAL

Share this post


Link to post
Share on other sites

Local $removeFile
$removeFile = FileDelete($THRegBkup)
If $removeFile Then
   _FileWriteLog($logHandler, "INFORMATION: File " & $THRegBkup & " deleted.")
Else
   _FileWriteLog($logHandler, "WARNING: File " & $THRegBkup & " not deleted or it does not exist.")
EndIf

 

You forgot to close the brackets.

1 person likes this

Share this post


Link to post
Share on other sites
Local $removeFile
$removeFile = FileDelete($THRegBkup)
If $removeFile Then
   _FileWriteLog($logHandler, "INFORMATION: File " & $THRegBkup & " deleted.")
Else
   _FileWriteLog($logHandler, "WARNING: File " & $THRegBkup & " not deleted or it does not exist.")
EndIf

You forgot to close the brackets.

Oh my God!!! Thanks, i was so obsessed about the conditions i didn't even think about that.

Share this post


Link to post
Share on other sites

I did something i was afraid might work and it did... instead of exporting the key:

HKEY_CURRENT_USERSoftwareHewlett-PackardHP Print SettingsUbicación predeterminadaTarget History

I exported the key:

HKEY_CURRENT_USERSoftwareHewlett-PackardHP Print Settings

And the reg file automatically appeared when i executed the program. So there's something wrong with that key name which i'm unable to find.

 

To try to solve this issue with accents in the RegKey name, change this on your script:

RunWait(@ComSpec & " /c " & $THRegBkup)

to

RunWait(@ComSpec & " /c chcp 1250 && " & $THRegBkup)

And try again.

Un saludo,

sahsanu

 

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

woops I misunderstood what you were doing,,

'?do=embed' frameborder='0' data-embedContent>>

is the way I found

I do not know if this fits your issue but being it is a registry matter, I after 3 months of massive reading and testing find a answer to adding a VAR to the registry..

I stripped what I had to and there isn't any checking for keystroke issues with the input box.. user can input ANYTHING  so if you use it add security to the input box

COPY and paste,, it runs as advertised.. It will add 2 different VAR to the registry and a text file to the desktop

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=cps250.ico
#AutoIt3Wrapper_Outfile=EvalYES.exe
#AutoIt3Wrapper_Res_Comment= equal to
#AutoIt3Wrapper_Res_Description=overlord
#AutoIt3Wrapper_Res_Fileversion=12.0.0.0
#AutoIt3Wrapper_Res_LegalCopyright=reardon studio
#AutoIt3Wrapper_Res_Language=1033
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
; *** Start added by AutoIt3Wrapper ***
#include <FontConstants.au3>
; *** End added by AutoIt3Wrapper ***

;SciTE
;Version 3.3.7
;    Dec 12 2013 20:45:19

#include  "ExtMsgBox.au3"

#include <MsgBoxConstants.au3>
#include <FileConstants.au3>
#include<string.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GuiTab.au3>
#include <Misc.au3>
#include <ColorConstants.au3>
#include <GuiButton.au3>
#include <ExtMsgBox.au3>
#include <constants.au3>
#include <WinAPI.au3>
$Regit1 = GUICreate("reg1", 621, 442, 192, 114)
;Opt("GUIOnEventMode", 1)
Local Const $1Font = "Tahoma"
$hButton1 = GUICtrlCreateButton("Register ", 20, 20, 1, 1, GUISetState(@SW_HIDE))
$hButton6 = GUICtrlCreateButton("Read Me", 20, 20, 1, 1, GUISetState(@SW_HIDE))
$hButton7 = GUICtrlCreateButton("Exit", 20, 20, 1, 1, GUISetState(@SW_HIDE))
GUICtrlSetState($hButton1, @SW_HIDE)
GUISetState(@SW_SHOW, $Regit1)
Button1Click()
Button6Click()
Button7Click()
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        Case $hButton1
            Button1Click()


        Case $hButton6
            Button6Click()


        Case $hButton7
            Exit
            Button7Click()


    EndSwitch
WEnd
Func Button6Click()
    Local $securityCodeEncryptionKey = "SonoM1EXHardBonus" ;this must match the applications key
    $str = InputBox("EXHard Registration", "Register to try for SonoM1 Full version Download for Free  Input first and last name")
    If @error = 1 Then Exit

    $Generate = StringUpper(StringRight($str, 5))
    $restore = StringUpper(_StringEncrypt(1, $Generate, $securityCodeEncryptionKey, 1))

    ClipPut($restore)

    MsgBox(0, "EXHard", "The registration code is: " & $restore & "Your code has been placed on the DESKTOP BONUS.TXT and clipboard You can paste it into a text file to save it")
    Local $sEvalString1 = Eval("$restore")
    #forceref $restore
    IniWrite(@DesktopCommonDir & "\BONUS.TXT", "General", "registration", $restore)
    Local $sString = DriveGetSerial(@HomeDrive & "\") ; Find the serial number of the home drive, generally this is the C:\ drive.
    #forceref $sString
    RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\RegisteredApplications", "CoreMaker", "REG_MULTI_SZ", "SOFTWARE\Coremaker\SonoM1\BonusAttempt\ControlCenter\Capabilities\" & $sString)
    RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\RegisteredApplications", "CoreVersion", "REG_MULTI_SZ", "SOFTWARE\Coremaker\SonoM1\" & $restore)
    FileCopy(@DesktopCommonDir & "BONUS.TXT", @AppDataCommonDir & "\BONUS.TXT", $FC_OVERWRITE + $FC_CREATEPATH)
EndFunc   ;==>Button6Click
Func Button1Click()
    GUICtrlSetState($hButton1, $GUI_ENABLE)
    $answer = MsgBox(4, "Get SonoM1 Full Verson for Free", "Get EXHard. ")
    If $answer = 7 Then
        MsgBox(0, "", "OK.  Bye!")
        Exit
    EndIf
    EndFunc   ;==>Button1Click
Func Button7Click()
    Exit
EndFunc   ;==>Button7Click
Edited by meows

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Similar Content

    • breakbadsp
      By breakbadsp
      I want to run a python script from autoit. 
      I know we can do this with shellexecute or run , but this python script takes 3 cmd line arguments.
      How to pass them from autoit script?
      I tried many ways.
      Following solution also not working 
      e.g. 
      RunWait( 'fullpath\Python.exe Scriptpath\ReadLog.py  -f "file.log" -k "key" -e "errMsg" ') Found solution:
      RunWait( 'fullpath\Python.exe ReadLog.py -f "file.log" -k "key" -e "errMsg" ', 'Working_directory_path')  
      PFB description:
      https://stackoverflow.com/questions/45757834/how-to-pass-command-line-arguments-to-a-python-script-anyscript-while-executin
       
    • StMaSi
      By StMaSi
      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\14.5.0.10018\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?
      Thank you.
    • Simpel
      By Simpel
      Hi.
      Local $sPDFtk = FileGetShortName(@ScriptDir & "\pdftk.exe") Local $sInputPDF = FileGetShortName(@ScriptDir & "\Prodis_Test.pdf") Local $sSig_1 = FileGetShortName(@ScriptDir & "\Sig_1.pdf") Local $sTempPDF = FileGetShortName(@ScriptDir & "\Prodis_Test_TEMP.pdf") $iSuccess = ShellExecuteWait($sPDFtk, $sInputPDF & " stamp " & $sSig_1 & " output " & $sTempPDF, "", "", @SW_HIDE) @ScriptDir is "H:\_Conrad lokal\Downloads\AutoIt3\_COX". As you can see there is a space in the path.
      I know that ShellExecuteWait is working with FileGetShortName at the filename. It seems to me that I can't pass the parameters that way. But without FileGetShortName it's not working too.
      Ideas? Regards, Conrad
    • WannaBeGut
      By WannaBeGut
      Hello,
      I just wrote a script that should copy data into my cloud using xcopy (cmd), but I want the Status Bar I have in my GUI to change it's text like that:
      working. -> working.. -> working... -> working. ...
      I would also like to make a button which interrupts xcopy (simply closing it should do the trick), but I don't know how to call ProcessClose("xcopy.exe") using a button, while I'am waiting for RunWait to finish.
      Example:
      $command = 'xcopy "' & @DesktopDir & '\text.txt"' & ' "\\ADMIN-CLOUD\private\" /EECHIY' $SW_STATE = @SW_HIDE RunWait(@ComSpec & " /c " & '"' & $command & '"', @DesktopDir, $SW_State) Please tell me if you need any further information! 
    • ur
      By ur
      I have written a script to build the Installshield project file(.ism) to setup files(.msi or .exe based on the release settings..).
      So when the user runs the script the process will be automatic for multiple ism files.
      Func Build($sOutputIsm,$ReleaseName,$sFilePath="None",$NewName="None") ;build the ism to get the msi If not FileExists($sOutputIsm) Then Logging("File Not Found: $sOutputIsm$",4) MsgBox($MB_OK + $MB_ICONERROR, "Error", "Could not find file ""$sOutputIsm$"".") Return EndIf Logging("Started Building $sOutputIsm$",4) ShowTrayTip($AppName, "Started Building $sOutputIsm$", 10, $TIP_ICONASTERISK) Dim $sBuildExe,$sBuildCommand,$Ret $sBuildExe = FindFileInPath("ISCmdBld.exe", "%ProgramFiles(x86)%\InstallShield") $sBuildCommand = """$sBuildExe$"" -p ""$sOutputIsm$"" -r ""$ReleaseName$"" -s" ;MsgBox(0,"",$sBuildCommand) $Ret = RunWait($sBuildCommand) If $Ret <> 0 Then ShowTrayTip($AppName,"ISM Build Failed, Please build the ISM Manually.",10, $TIP_ICONHAND) MsgBox($MB_OK + $MB_ICONERROR, "Error", "Could not build ""$sOutputIsm$"". Please build manually.") Logging("Error $Ret$ while Building $sOutputIsm$",4) Return;Exit(1) Else ShowTrayTip($AppName,"ISM Build Completed",10, $TIP_ICONASTERISK) Logging("Completed Building $sOutputIsm$",4) if not StringCompare($NewName, "None")=0 then MoveEXE($sFilePath,$NewName) EndIf EndFunc The problem is when we run the ISCmdBuild.exe the RunWait will give whether fail or success but not what are the errors we got.
      If we use Run, it will give that logging but we don't have the feature of getting fail/success as RunWait.
      If we run the above code by removing -s and using redirection operator > to a file, it is running manually but failing with autoit.
      Like
       
      $sBuildCommand = """$sBuildExe$"" -p ""$sOutputIsm$"" -r ""$ReleaseName$"" > c:\logs\uday.log" Any help on this??
       
      And also, in some machines the installshield shortcut is launching fine as licensed version but with ISCmdBld.exe it is giving error as licensing info missing or not registered.
       
      Any suggestion on this too??