By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,827 Members | 2,220 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,827 IT Pros & Developers. It's quick & easy.

O.T. - but stemming from an Access Application objective

P: n/a
MLH
I would like to launch an A97 runtime
application, doing one additional thing
immediately prior to launching.

Here's the Target property setting of
the desktop icon I now use to launch
the runtime app:

"C:\Program Files\AppDir\MyApp.mde"

What I want is to do immediately prior
to opening the A97 runtime application is
perform a simple DOS activity first: I want
to copy c:\FileA.ext to c:\FileB.ext. I want
to wait for the operation to complete before
launch of the runtime app.

Can someone recommend some kind of
windows batching method which would enable
me to copy my file and launch my A97 app by
dbl-clicking only a single icon on the desktop?
I heard windows XP had something like that
built-in. If it does, I can't find it.
Jun 2 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Study up vbscript. Batch files on steriods. Actually, most VB commands are
available, but in a file that you create in notepad and run just by invoking
the name, myscript.vbs for instance.

Warning: You can get annoying prompts about allowing macros to run. YOu
will have to change some settings if you have this problem.
Jun 2 '06 #2

P: n/a
You could write a windows script.

Using the run method of the WSript.Shell object you can tell it to wait
until the tak completes before continuing.

Something like:
' *********************************************
Dim wshShell
dim strShell1
dim strShell2
dim strshell3

Set WshShell = CreateObject("WScript.Shell")
' ****************************************
' You need to change these paths
Const FILE_SOURCE = """e:\automation\data\source.txt"""
Const FILE_TARGET = """e:\automation\archive\target.txt"""
CONST WINDOW_STYLE = 1
CONST WAIT_FOR_TASK = -1

' ************************************************** ***
' contracts3
strShell1 = "CMD /c DEL " & FILE_TARGET
strShell2 = "CMD /c copy " & FILE_SOURCE & ", " & FILE_TARGET
strshell3 = "c:\somedir\some.mdb"

On Error Resume Next
WshShell.Run strshell1, WINDOW_STYLE, WAIT_FOR_TASK

On Error GoTo 0
WshShell.Run strshell2, WINDOW_STYLE, WAIT_FOR_TASK

WshShell.Run strshell3, WINDOW_STYLE

SET WshShell = Nothing
' *********************************************

Alternatively you could instantiate a FileSystemObject in the scipt and use
that to copy the file.

Look in MSDN for more help

--

Terry Kreft
"MLH" <CR**@NorthState.net> wrote in message
news:br********************************@4ax.com...
I would like to launch an A97 runtime
application, doing one additional thing
immediately prior to launching.

Here's the Target property setting of
the desktop icon I now use to launch
the runtime app:

"C:\Program Files\AppDir\MyApp.mde"

What I want is to do immediately prior
to opening the A97 runtime application is
perform a simple DOS activity first: I want
to copy c:\FileA.ext to c:\FileB.ext. I want
to wait for the operation to complete before
launch of the runtime app.

Can someone recommend some kind of
windows batching method which would enable
me to copy my file and launch my A97 app by
dbl-clicking only a single icon on the desktop?
I heard windows XP had something like that
built-in. If it does, I can't find it.

Jun 2 '06 #3

P: n/a
"Rick Wannall" <wa*****@notadomain.de> wrote in
news:4r******************@newssvr14.news.prodigy.c om:
Study up vbscript. Batch files on steriods. Actually, most VB
commands are available, but in a file that you create in notepad
and run just by invoking the name, myscript.vbs for instance.


Well, you might need to specify the name of the scripting host if
the machine has been properly safeguarded to not execute VBS
automatically.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Jun 2 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.