Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - automate running JETCOMP.exe utility to compact an Access db

Reply
 
Old 05-20-2009   #1 (permalink)
JRough


 
 

automate running JETCOMP.exe utility to compact an Access db

I want to automate
running JETCOMP.exe utility to compact an Access database with
vbscript using the .run command however I first need to get the
utility to run before I can automate it. I don't know if I should run
it with CMD /C or without
at the DOS prompt because neither seems to work. I verified the
paths.


CMD /C "c:\Program Files\Microsoft Office\JETCOMP.exe" /s "c:\SwimClub
\acsc_be"

I get the error message 'c\Program' is not recognized as an internal
or external command, operable program or batch file"

If I run it without the CMD /c for example "c:\Program Files\Microsoft
Office\JETCOMP.exe" /s "c:\SwimClub\acsc_be" then I don't get any
messages at all. All I get is the DOS prompt back alone for example
like this:
C:\Documents and Settings\janis>

So I just need to see if one of these commands will work and compact
the database then I can put it either in a batch file or a vbscript
file whichever is easier since I don't know how to do either one but I
think I prefer the vbscript one since I can put the vbscript icon on
the users desktop and the user can run it from there.
thanks,
Janis

My System SpecsSystem Spec
Old 05-20-2009   #2 (permalink)
Bob Barrows


 
 

Re: automate running JETCOMP.exe utility to compact an Access db

JRough wrote:
Quote:

> I want to automate
> running JETCOMP.exe utility to compact an Access database with
> vbscript using the .run command however I first need to get the
> utility to run before I can automate it. I don't know if I should run
> it with CMD /C or without
> at the DOS prompt because neither seems to work. I verified the
> paths.
>
>
> CMD /C "c:\Program Files\Microsoft Office\JETCOMP.exe" /s "c:\SwimClub
> \acsc_be"
>
> I get the error message 'c\Program' is not recognized as an internal
> or external command, operable program or batch file"
>
> If I run it without the CMD /c for example "c:\Program Files\Microsoft
> Office\JETCOMP.exe" /s "c:\SwimClub\acsc_be" then I don't get any
> messages at all. All I get is the DOS prompt back alone for example
> like this:
> C:\Documents and Settings\janis>
You need to remove the /s, which does not seem to be a valid
command-line switch for this utility.
See http://www.pcreview.co.uk/forums/thread-1072504.php





--
HTH,
Bob Barrows


My System SpecsSystem Spec
Old 05-20-2009   #3 (permalink)
Bob Barrows


 
 

Re: automate running JETCOMP.exe utility to compact an Access db

JRough wrote:
Quote:

> I want to automate
> running JETCOMP.exe utility to compact an Access database with
Here is someone who says he got it working (see last message):
http://forums.devx.com/archive/index.php/t-51812.html

--
HTH,
Bob Barrows


My System SpecsSystem Spec
Old 05-20-2009   #4 (permalink)
Richard Mueller [MVP]


 
 

Re: automate running JETCOMP.exe utility to compact an Access db


"Bob Barrows" <reb01501@xxxxxx> wrote in message
news:ey3SPRV2JHA.1644@xxxxxx
Quote:

> JRough wrote:
Quote:

>> I want to automate
>> running JETCOMP.exe utility to compact an Access database with
>
> Here is someone who says he got it working (see last message):
> http://forums.devx.com/archive/index.php/t-51812.html
>
> --
> HTH,
> Bob Barrows
>
>
Assuming the command line in the link above works, you would run it in a
VBScript program as follows:
===========
Set objShell = CreateObject("Wscript.Shell")
strCmd = "%comspec% /c ""C:\Downloads\JETComp\JETCOMP.exe"" " _
& """-src:C:\Jetcomp\Bad.Mdb"" ""-dest:C:\Jetcomp\Good.Mdb"""
Wscript.Echo strCmd
objShell.Run strCmd
========
The Wscript.Echo command is to verify that the command looks correct. Note
that quote characters imbedded in the string must be doubled. When the
command is echoed to the command console, it should look exactly like the
command you would enter yourself manually. For testing, comment out the
objShell.Run command. After verifying the command, uncomment the
objShell.Run and comment out (or remove) the Wscript.Echo command.

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
JETCOMP.exe utility switch to path to database to compact VB Script
vb script to compact Access database, how to add login & pw VB Script
Type mismatch:'alert' vbscript to compact access db VB Script
WMUtil -- New Free utility to compact and repair the Windows Mail database in Windows Vista Vista mail


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46