Solved

AutoRun

Posted on 2004-08-29
13
364 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
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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
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.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

821 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