Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
Okay maybe the & does the same thing in powershell that it does in cmd. :( –  leeand00 Aug 23 '12 at 3:28

1 Answer 1

up vote 2 down vote accepted

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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.