?
Solved

AutoRun

Posted on 2004-08-29
13
Medium Priority
?
374 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
Does Your Cloud Backup Use Blockchain Technology?

Blockchain technology has already revolutionized finance thanks to Bitcoin. Now it's disrupting other areas, including the realm of data protection. Learn how blockchain is now being used to authenticate backup files and keep them safe from hackers.

 

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Suggested Courses

765 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