Vbs code in my action?

(imported topic written by johnism91)

Ok I know I have to be missing somthing …

Below work fine by its self

download http://TEST/Uploads/d4b1c261d8b66bd6c8e667219643c528ea1ef60e/RightFax93.tmp

continue if {(size of it = 14385570 AND sha1 of it = “d4b1c261d8b66bd6c8e667219643c528ea1ef60e”) of file “RightFax93.tmp” of folder “__Download”}

extract RightFax93.tmp

And this works fone as a stand alone vbs ( well have not been able to succesfully test the copy “_download” but it work with a test folder in place.

Dim Message

Dim fso

set fso = createobject(“scripting.filesystemobject”)

fso.CreateFolder “C:\INSTALL\RightFax93”

fso.movefolder “__Download*.*”, “C:\INSTALL\RightFax93”

set fso=nothing

WScript.Sleep 5000

WScript.Quit

wait C:\INSTALL\RightFax93\setup.exe

so my total action looks like this

download http://test/Uploads/d4b1c261d8b66bd6c8e667219643c528ea1ef60e/RightFax93.tmp

continue if {(size of it = 14385570 AND sha1 of it = “d4b1c261d8b66bd6c8e667219643c528ea1ef60e”) of file “RightFax93.tmp” of folder “__Download”}

extract RightFax93.tmp

Dim Message

Dim fso

set fso = createobject(“scripting.filesystemobject”)

fso.CreateFolder “C:\INSTALL\RightFax93”

fso.movefolder “__Download*.*”, “C:\INSTALL\RightFax93”

set fso=nothing

WScript.Sleep 5000

WScript.Quit

wait C:\INSTALL\RightFax93\setup.exe

and I get and error "Unable to prase action script for Action1 line 4 (first Dim )

Unknow action command"

Thanks for help ,

John

(imported comment written by johnism91)

oh I guess I kind of need to say what I am doing … I can not have the installer run from the _download directy the programer codeit so that it has to run for C:\Install\RightFax93. So with vb I am creating the dir and then coping the files from _download.

(imported comment written by MattBoyd)

Hey John,

I think most people just use the DOS move command or xcopy.exe to move a folder. However, if you want to include your vbscript in the action code like that, you’ll need to do it with createfile. Here’s an example (changes in bold):

download http://test/Uploads/d4b1c261d8b66bd6c8e667219643c528ea1ef60e/RightFax93.tmp
continue if {(size of it = 14385570 AND sha1 of it = “d4b1c261d8b66bd6c8e667219643c528ea1ef60e”) of file “RightFax93.tmp” of folder “__Download”}

extract RightFax93.tmp

//Create a new text file and put your vbscript code in it
createfile until ENDOFFILE
Dim Message
Dim fso
set fso = createobject(“scripting.filesystemobject”)

fso.CreateFolder "C:\INSTALL\RightFax93"
fso.movefolder “__Download*.*”, "C:\INSTALL\RightFax93"
set fso=nothing

WScript.Sleep 5000
WScript.Quit
ENDOFFILE

//This deletes the script if it was already there. Otherwise, the subsequent copy command will fail.
delete copyscript.vbs

copy __createfile copyscript.vbs

//run copyscript to copy the files
wait cscript.exe copyscript.vbs

wait C:\INSTALL\RightFax93\setup.exe

(imported comment written by johnism91)

score thank you