Jump to content

Help w/ winmgmt /verifyrepository in script.


Recommended Posts

I have this line in my script along w/ winmgmt /backup and winmgmt /syncperf

RunWait(@ComSpec & " /c winmgmt /verifyrepository" , "", @SW_hide )

All of them work cept the one shown above. It throws an 8007007e error(I think thats module not found). It runs fine if I run it in cmd prompt directly. It just wont work through my script.

Any ideas?

Edited by GenTarkin
Link to comment
Share on other sites

Have you tried putting this line only in it's own script and running it from there? Are you trying to scan the backup that you are making or the active WMI repository? Perhaps you left out the 'Wait' portion of RunWait on another line and you're trying to hit the repository with two commands at once.

I had no trouble with the above line running on my Win7 machine.

Support bacteria; it's the only culture most people have.LxP's Learning to Script with AutoIt 3 - Excellent starting placeVolly's Links Page - Links to cool and useful scriptsAutoIt Wrappers - Valuater's AutoIt Wrappers post. Lots of good stuff.Support AutoIt - Make a donation here; I did.[size="2"]#include <Guinness.pint>[/size]

Link to comment
Share on other sites

Have you tried putting this line only in it's own script and running it from there? Are you trying to scan the backup that you are making or the active WMI repository? Perhaps you left out the 'Wait' portion of RunWait on another line and you're trying to hit the repository with two commands at once.

I had no trouble with the above line running on my Win7 machine.

Active repository, Ive tried it on its own line in its own script. Ive run it on several diff win machines. All same result =/

Link to comment
Share on other sites

Try RunWait(@ComSpec & " /k winmgmt /verifyrepository" , ""). This way the cmd prompt sticks around and doesn't run hidden. Maybe it can give you more insight.

Just curious, if you are running the command with @SW_hide, where are you seeing the results? How are you capturing the 8007007e error?

Support bacteria; it's the only culture most people have.LxP's Learning to Script with AutoIt 3 - Excellent starting placeVolly's Links Page - Links to cool and useful scriptsAutoIt Wrappers - Valuater's AutoIt Wrappers post. Lots of good stuff.Support AutoIt - Make a donation here; I did.[size="2"]#include <Guinness.pint>[/size]

Link to comment
Share on other sites

Have you tried running it with elevated privileges?

; Change the administrator and password below to an administrator account username and password
RunAsWait("administrator", @ComputerName, "password", 0, @ComSpec & " /k winmgmt /verifyrepository")

Do you get the same results with this command?

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Look at the help file section: Running under Windows 64-bit Edition

Either compile script as x64 or use the disable redirection call

;#AutoIt3Wrapper_UseX64=y
DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1)
RunWait(@ComSpec & " /c winmgmt /verifyrepository" , @SystemDir, @SW_HIDE)
Edited by rover

I see fascists...

Link to comment
Share on other sites

Ah, very interesting. I need this single script to work on both 32 and 64bit so woulld I just put a conditional statement and run the stated above code in the 64bit branch?

Or, could I just run the dllcall either way, and it just error out "behind the scenes" on a 32bit machine? and keep running script.

Edited by GenTarkin
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...