Solved

AutoRun

Posted on 2004-08-29
13
359 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 

Author Comment

by:chestera
Comment Utility
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
Comment Utility
Bluelizard

Thanks for that I will give it ago

chestera
0
 

Author Comment

by:chestera
Comment Utility
BlueLizard

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

chestera
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 14

Expert Comment

by:bluelizard
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
blueLizard

Many thanks for your help I will do as you suggest

chestera
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now