1

I'm trying to compact a MS-Access database using JetComp.exe using a powershell script.

Here is the operative lines:

# 4. Run JetComp
LogWrite("Begin: Running JetComp")
.\JETCOMP.EXE -src: $srcDB -dest: $dstDB | Out-Null  #Run this command and wait for it to finish...
IfErrorExit("Error Compacting Database")
LogWrite("End: Running JetComp")

The JETCOMP.EXE program seems to complete long before it is actually finished and the $dstDB ends up being smaller than the compact should even make it. Initially ($srcDB) it's about 1.8 GB and by the time the command finishes it's about 300,000 kb (about 0.29 gb) that's a pretty long way off from 1.8 gb which when compacted manually ends up being about 1.6 gb.

Is there some sort of timeout I don't know about in powershell scripts?

P.S. I know that when running JETCOMP.EXE manually, that the system often detects it as "not responding" even though it's actually getting the job done, and waiting long enough will allow it to complete.

leeand00
  • 4,807
  • 13
  • 64
  • 106

1 Answers1

2

That number is suspiciously close to 2x the 150MB Remote Powershell memory limit. If this indeed your problem, it's possible that JETCOMP is not getting enough RAM to do that it needs to do and is failing quietly. If you are running this through remote-PS, you can check the limits thusly:

Get-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB

And to set them:

Set-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB 1024
sysadmin1138
  • 131,083
  • 18
  • 173
  • 296