Jump to content
Sign in to follow this  
h3xl3y

What do you think is wrong in this ?

Recommended Posts

I have this script that was working before i added unpacking

#include <Misc.au3>   ;For Do-Until _IsPressed
#include <File.au3>
#include <Array.au3> 

$app = "app.exe"
$app1 = "splash.exe"
$extract = "D:\Extract"
$Temp = "D:\Temp\"
$Source = $CmdLine[1]

If $CmdLine[0] == 1 Then
    DirCreate( $Temp )
    RunWait('"'& $extract & '\7z.exe"' & ' x "' & $Source & '" ' & "-y -o" & '"' & $Temp & '"', "", @SW_HIDE)
    Run( $app1 )
    Do
      Sleep(1)
    Until _IsPressed( "20" )      ;Space
    Local $search = FileFindFirstFile($Temp & '*.*')
    If $search = -1 Then exit 0
    Local $file = FileFindNextFile($search)
    FileClose($search)
    Run('"' & $app & '" "' & $file & '"')
    ProcessClose( $app1 )
    While ProcessExists( $app )
       Sleep(500)
    WEnd
    ProcessWaitClose( $app )
    DirRemove( $Temp, 1)
    Exit 0
EndIf

It all works good until $file should be completed

Before i had $CmdLine[1] instead of $file

Run('"' & $app & '" "' & $CmdLine[1] & '"')
Edited by h3xl3y

Share this post


Link to post
Share on other sites

You are missing a space between the end double quote of the programname and the start double quote of the parameter.

Run('"' & $app & '" "' & $file & '"')

Jos


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

You are missing a space between the end double quote of the programname and the start double quote of the parameter.

Run('"' & $app & '" "' & $file & '"')

Jos

Sorry that was an typo, because i modified it a few times and didn't notice it was wrong

but it is not working with space

Share this post


Link to post
Share on other sites

What version of AutoIt you using?

@AutoItVersion

Never mind, I see you are running compiled.

Local $file = FileFindNextFile($search)
MsgBox(0, "Info", $file & " error - " & @error & @lF)
Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

the output is   filename error - 0

MsgBox(0, "Info", $file & @lF)

and from this code i see that $file  is the name i want

if i get the same name from $file as i did from $CmdLine[1] then why is not working ?

Edited by h3xl3y

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...