Solved

AutoRun

Posted on 2004-08-29
13
371 Views
Last Modified: 2008-01-09
Hi

I have an Autostart.ini with the following

[Autorun]
open=Net\setup.exe
open=Xls\setup.exe

The first line installs files into a folder called PSRMS. The second line should install files into a sub folder. My problem is Auto run will run the first line but ignores the second line. How can I get the second line to run. Both setup.exe are generated using Office for Developers 97.

chestera
0
Comment
Question by:chestera
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
13 Comments
 
LVL 66

Expert Comment

by:Jim Horn
ID: 11928508
Instead of using an .ini file, how about setting a Startup Form, and in VBA code behind the form (or call a separate module if you prefer), write a Shell command that does both.

That way you can debug it, and don't have the dependancy of the .ini file.

Hope this helps.
-Jim
0
 
LVL 34

Expert Comment

by:flavo
ID: 11928549
or use a vbs file and call that in the ini

example:

[Autorun]
open=open.vbs


open.vbs code


Dim WshShell
Set WshShell = CreateObject("Wscript.Shell")
WshShell.Run Net\setup.exe
WshShell.Run xls\setup.exe

Set WshShell = nothing


Dave

0
 
LVL 14

Expert Comment

by:bluelizard
ID: 11928791
i assume these are "DOS"-commands...: you can put all these into a .bat file, e.g.:

  Net\setup.exe
  Xls\setup.exe

then specifiy that bat file as the one to auto-run:

[Autorun]
open=MyBatch.bat


--bluelizard
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:chestera
ID: 11928796
flavo

Dave I have tried the above but now it wont Auto install am I missing something. I have typed

[Autorun]
open=open.vbs

open.vbs code

Dim WshShell
Set WshShell = CreateObject("Wscript.Shell")
WshShell.Run Net\setup.exe
WshShell.Run xls\setup.exe

Set WshShell = nothing

chestera
0
 

Author Comment

by:chestera
ID: 11928805
Bluelizard

Thanks for that I will give it ago

chestera
0
 

Author Comment

by:chestera
ID: 11929089
BlueLizard

Putting a .Bat file in the auto run still only runs the first setup.exe

chestera
0
 
LVL 14

Expert Comment

by:bluelizard
ID: 11929686
normally, in a batch file, line after line is executed.  so, after setup.exe has terminated, the commenad on the second line will run.  is it possible that setup.exe doesn't really terminate (maybe, a window stays open or something)?  in that case, you can write

  start Net\setup.exe

instead of just Net\setup.exe: this will start Net\setup.exe and will *immediately continue* with the command on the second line.  note that both setups will be executed at the same time, then.


--bluelizard
0
 

Author Comment

by:chestera
ID: 11929825
Bluelizard

Thanks for that. I have been playing around with access as JimHorn has mentioned and I have got it working quite well. The Developers setup wizard installs a set up folder as well as the required files. This setup folder is not required if Access already on the machine so I am using the Scripting run (obj.DeleteFolder)to delete the setup folder. Trouble is the folder is enabled as readonly. is there away of removing readonly by code. I will give points to you and Jim.

Alan
0
 
LVL 14

Expert Comment

by:bluelizard
ID: 11930025
sounds good.

to clear the read-only bit, you can use the DOS command "attrib". in VB:

  Shell("attrib -r C:\path\to\myfolder")


--bluelizard
0
 

Author Comment

by:chestera
ID: 11930853
BlueLizard

I am using the SetAttr "C:\Folder\Setup", vbHidden

This Hides the setup folder. This will do for now

For some reason using SetAttr "C:\Folder\Setup", vbNormal wont remove Readonly. It works if I create a folder and make it readonly. But it wont remove Readonly if taken off a CD. I will try Shell("Attrib etc )and see if that works

chestera
0
 

Author Comment

by:chestera
ID: 11930945
Bluelizard

Tried    Shell("attrib -r C:\path\to\myfolder"). No go. I get the error message
Runtime error 70
Permission denied
I assume it's because it's readonly. Just went into Windows explorer and removed the readonly so can now delete the setup folder

chestera
0
 
LVL 14

Accepted Solution

by:
bluelizard earned 50 total points
ID: 11931061
ok; if SetAttr won't remove the read-only, then i guess Shell("Attrib -r ...") has the same problem...  since the error message mentions permission problems, it could be that files taken off a CD get a different owner and/or don't inherit "full control" permissions from the folder they're copied into.  if you want a solution for this, i suggest you post another question here: i'm sure there are expert that can help you on this...  (i can't...).


--bluelizard
0
 

Author Comment

by:chestera
ID: 11936303
blueLizard

Many thanks for your help I will do as you suggest

chestera
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question