FOR EACH

Got a problem you cannot solve? Try here.
jdeleon7010
Posts: 27
Joined: Thu Jul 26, 2012 2:23 pm

FOR EACH

Postby jdeleon7010 » Wed Aug 29, 2012 11:41 am

Hello,

I am seeing an issue when running a read from file command within a for each routine. It looks like the variable is not updating when a read from file is called. Here is my code.

Code: Select all

~InstallAware Clipboard Data~
~Wend~
~{B89F7EFB-353B-4DB5-A7FD-6AC5E7B5FEB1}~
~Next~
~{E3996076-FF25-46CD-9F27-C9BC09AF699B}~
~Read from Text File~
~{92D028E3-D1F0-4111-BF14-0A1203FB8210}~
~$SD$\_TMP\In-Use-Check.txt~
~IN-USE~
~EOF1~
~Run Program~
~{6E993DA3-40CC-494D-A4C9-B3DAE0B3E9E4}~
~wscript.exe~
~TRUE~
~$SD$\_TMP\file_in_use.vbs $PROFILES$\$USERDIR$\ntuser.dat~
~TRUE~
~~
~Delete Files~
~{531E831B-E0EC-478A-993D-69A76AD95479}~
~$SD$\_TMP~
~In-Use-Check.txt~
~TRUE~
~FALSE~
~For Each~
~{6BF0B032-D1CA-48D6-90CB-46B574612E2B}~
~USERDIR~
~$NEWLINE$~
~$DIRECTORY$~
~Read from Text File~
~{792B668B-01E0-47BC-80B9-64A75EE3F796}~
~$SD$\_TMP\DIR.txt~
~DIRECTORY~
~EOF~
~While~
~{3C44A032-62F7-4F9D-8E8D-1DCA19133585}~
~EOF~
~0~
~FALSE~
~FALSE~
~Set Variable~
~{DE2F3593-34E9-4183-BBF2-D410E2811411}~
~EOF$MYAH$MYAH$FALSE~
~FALSE~
~Run Program~
~{BE62BC19-958D-409E-81C4-CC93EA956A21}~
~cmd~
~TRUE~
~/c dir "$PROFILES$" /b /ad > $SD$\_TMP\DIR.txt~
~TRUE~
~~
~Delete Files~
~{8ED2AB56-3A3F-4589-B8EE-F8D91936FE7C}~
~$SD$\_TMP~
~DIR.txt~
~TRUE~
~FALSE~


FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: FOR EACH

Postby FrancescoT » Thu Aug 30, 2012 10:49 am

Dear User,

could you please post the text file you are reading from?

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

jdeleon7010
Posts: 27
Joined: Thu Jul 26, 2012 2:23 pm

Re: FOR EACH

Postby jdeleon7010 » Thu Aug 30, 2012 2:52 pm

It is the out put of user names from the C:\Users folder and contains the following text.

Administrator
All Users
Default
Default User
Public
Test

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: FOR EACH

Postby FrancescoT » Mon Sep 03, 2012 1:52 am

Dear User,

I tested your code, but your issue is caused by the way you used the retrive the data from the text file.
The entire file is not read without pre-pending #READALL\ to the file name.

So please use it as following:

Code: Select all

~InstallAware Clipboard Data~
~Read from Text File~
~{C4CDBF87-564B-406A-A1CC-6D22F843D1F0}~
~#READALL\$SD$\_TMP\DIR.txt~
~DIRECTORY~
~EOF~


Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 55 guests