Solved

AutoRun

Posted on 2004-08-29
13
367 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 65

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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

732 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