Jump to content
Sign in to follow this  
Program

Run a Rundll32 dos command

Recommended Posts

Hi there,

I want to run a dos command that when i enter into cmd and hit enter it runs fine:

RunDll32 C:\PROGRA~1\COMMON~1\INSTAL~1\engine\6\INTEL3~\Ctor.dll,LaunchSetup "C:\Program Files\InstallShield Installation Information\{409370D3-226D-412A-852A-F134B89F7116}\Setup.exe" -l0x9

( it is to run an uninstall program)

If i try to run this using the run command and the @COMSPEC macro like so:

Run(@COMSPEC & " /c ""RunDll32 C:\PROGRA~1\COMMON~1\INSTAL~1\engine\6\INTEL3~1\Ctor.dll,LaunchSetup ""C:\Program Files\InstallShield Installation Information\{{}409370D3-226D-412A-852A-F134B89F7116{}}\Setup.exe"" -l0x9"" ")

it doesnt run the program.

Im sure ive got the correct syntax. The problem is that if i run that command at the command line and hit enter it works! so i thought it should work using @COMSPEC, this is the same with any rundll32 uninstall applications. The path for these are located in HKEY_LOCAL_MACHINE\software\microsoft\windows\currentversion\unistall

so there is bound to be one on your pc you can test out

I even tried to put this command in a .bat file but it still doesn run, i simply copied the first statement above into the .bat file, is this how you would do this?

Anyhow, i would expect that the command should work using the @COMSPEC macro, any ideas why it doesnt?

Share this post


Link to post
Share on other sites

what about? :

Run(@COMSPEC & " /c RunDll32 RunDll32 C:\PROGRA~1\COMMON~1\INSTAL~1\engine\6\INTEL3~\Ctor.dll,LaunchSetup ""C:\Program Files\InstallShield Installation Information\{409370D3-226D-412A-852A-F134B89F7116}\Setup.exe"" -l0x9")

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Thanks heaps that worked.

i thought you needed to use {}} and {{} but obviously you didnt??!

Not needed ..... anything between the "..." is treathed as string. You are confused with a SEND command string.

All i did was take your working command line and changed the single " to ""

You can also take your commandline and put it between single quotes....

That's all it takes...

Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Im getting the weirdest results with my rundll32 experimentation......

What im doing is adding a registry key to the RunOnce directory in regedit so that the rundll32 command will run at startup....

If i put this single command in a file it will run fine:

Run(@COMSPEC & " /c RunDll32 C:\PROGRA~1\COMMON~1\INSTAL~1\engine\6\INTEL3~1\ctor.dll,LaunchSetup ""C:\Program Files\InstallShield Installation Information\{95E35475-E696-4D0D-96DB-7A7156F2AC85}\setup.exe"" ")

Exit

But i want to interact with the rundll32 program i am running so i have put other commands along with it but when i run this from runonce i get an error :

Error loading C:\PROGRA~1\COMMON~1\INSTAL~1\engine\6\INTEL3~1\ctor.dll

The specified module could not be found.

Any way here is the source code can anyone see anything that is obviously wrong????:

;******************************************************************

AutoItSetOption("TrayIconDebug", 1)

AutoItSetOption("WinTitleMatchMode", 2)

FileCopy("\\sydney\applications\scripts\InstallAST.exe","C:\")

;These will not be here when install script is completed

;--------------------------------------------------------

RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","DefaultPassword")

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","AutoAdminLogon","REG_SZ","0")

;--------------------------------------------------------

;and this will be enabled!

;-------------------------------------------------------

;RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce","install","REG_SZ","C:\InstallAST.exe")

Run(@COMSPEC & " /c RunDll32 C:\PROGRA~1\COMMON~1\INSTAL~1\engine\6\INTEL3~1\ctor.dll,LaunchSetup ""C:\Program Files\InstallShield Installation Information\{95E35475-E696-4D0D-96DB-7A7156F2AC85}\setup.exe"" ")

FileDelete("C:\UninstallAST.exe")

If WinWait("Welcome","",10) <> 1 Then

If RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Solution 6\FixedAssets","VERSION") < 1 Then

MsgBox(16,"William Buck Network Administration", "Assets not installed",3)

Run("C:\restart.exe")

Exit

EndIf

EndIf

;Do the uninstall

WinActivate("Welcome")

Send("{DOWN}{DOWN}{ENTER}")

WinWaitActive("Confirm File Deletion")

Send("{ENTER}")

WinWaitActive("Shared File Detected")

Send("{SPACE}{ENTER}")

WinWaitActive("Solution 6 Assets Workstation")

Send("{ENTER}")

Run("C:\restart.exe")

Exit

;****************************************************

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...