Recommended Posts

Hi,

Is it possible to execute autopatcher from a network?

What i like to do is:

I've extracted/installed the latest autopatcher xp

I moved the complete autopatcher directory from programfiles to a net workshare.

I've placed this command in winbom.ini

[OemRunOnce]

"AutoPatcher","""\\servername\d\AutoPatcher\AutoPatcher.exe"" "

but after i agree with the terms of use i get a runtime error 5

anyone suggestions?

Link to comment
https://www.neowin.net/forum/topic/422251-launch-autopatcher-from-networkshare/
Share on other sites

Hi,

Is it possible to execute autopatcher from a network?

What i like to do is:

I've extracted/installed the latest autopatcher xp

I moved the complete autopatcher directory from programfiles to a net workshare.

I've placed this command in winbom.ini

[OemRunOnce]

"AutoPatcher","""\\servername\d\AutoPatcher\AutoPatcher.exe"" "

but after i agree with the terms of use i get a runtime error 5

anyone suggestions?

Yeah, autopatcher will only run from a mapped drive from a network share. I used pushd and popd to temporarily map a drive and run autopatcher in between. Threw it into a batch file, and with CMDOW the cmd window calling the batch can even be hidden.

My batch is as follows:

----------------------------

@copy /y \\servername\autopatcher\cmdow.exe %systemroot%\system32\cmdow.exe

@cmdow @ /hid

pushd \\servername\autopatcher

autopatcher.exe /noeula /unattend:t2

popd \\servername\autopatcher

----------------------------

Of course, the /noeula prevents having to accept the eula, and the unattend:t2 completes the unattended aspect with just a small notification window. You could also use t3 to make it completely invisible.

This is in my startup scripts though, not during an unattended OS install, so YMMV.

Yeah, autopatcher will only run from a mapped drive from a network share. I used pushd and popd to temporarily map a drive and run autopatcher in between. Threw it into a batch file, and with CMDOW the cmd window calling the batch can even be hidden.

My batch is as follows:

----------------------------

@copy /y \\servername\autopatcher\cmdow.exe %systemroot%\system32\cmdow.exe

@cmdow @ /hid

pushd \\servername\autopatcher

autopatcher.exe /noeula /unattend:t2

popd \\servername\autopatcher

----------------------------

Of course, the /noeula prevents having to accept the eula, and the unattend:t2 completes the unattended aspect with just a small notification window. You could also use t3 to make it completely invisible.

This is in my startup scripts though, not during an unattended OS install, so YMMV.

Thanks, Ill give it a try

What does this command actually does? pushd and popd?

What i want to do is add updates to autopatcher without making a new ghost image.

So i only have to update/add updates to autopatcher which is placed on a network share.

I hope you understand what i mean

Edited by arjanv

Thanks, Ill give it a try

What does this command actually does? pushd and popd?

What i want to do is add updates to autopatcher without making a new ghost image.

So i only have to update/add updates to autopatcher which is placed on a network share.

I hope you understand what i mean

Sure do, I do exactly the same thing for the same reasons. Autopatcher has reduced my image creation tasks easily by half. We manually run autopatcher on our newly ghosted machines, and run it automatically on each startup to keep our machines completely updated.

According to the help files, pushd "will create a temporary drive letter that points to that specified network resource and then change the current drive and directory, using the newly defined drive letter. Temporary drive letters are allocated from Z: on down, using the first unused drive letter found." Popd "will delete any temporary drive letter created by PUSHD when you POPD that drive off the pushed directory stack."

You could of course just create a permanent drive mapping (not you yourself, you figuratively) and not bother with pushd and popd, but in my environment I can't be sure any drive letter is free, so this works to pick one for me.

Sure do, I do exactly the same thing for the same reasons. Autopatcher has reduced my image creation tasks easily by half. We manually run autopatcher on our newly ghosted machines, and run it automatically on each startup to keep our machines completely updated.

According to the help files, pushd "will create a temporary drive letter that points to that specified network resource and then change the current drive and directory, using the newly defined drive letter. Temporary drive letters are allocated from Z: on down, using the first unused drive letter found." Popd "will delete any temporary drive letter created by PUSHD when you POPD that drive off the pushed directory stack."

You could of course just create a permanent drive mapping (not you yourself, you figuratively) and not bother with pushd and popd, but in my environment I can't be sure any drive letter is free, so this works to pick one for me.

Hi, rtk

Thanks for your help.

It works perfectly.

  • 2 weeks later...

:yes: This Deserves a sticky! Bump

I tried mapping with net use without any luck, this worked great!

I'd vote for it to be added to the "FAQ / Common Problems & Solutions" thread instead of making this one sticky.

At least or until AP supports UNC paths, this solution does seem to work well.

  • 1 month later...

I don't have a lot of experience with AutoPatcher but the batch method described worked perfectly.

1. Can new updates be applied to the network share or does it need to be done locally and copied to the share?

2. Is there a way to configure so that the user installing can select when the system is restarted instead of it automatically rebooting?

3. How do I configure AutoPatcher to have all the available Critical and Recommended updates as the default?

  • 3 months later...

Thanks rtk !!!

Q1: In wanting to use a /defaults ini like:

/noeula /defaults:C:\AutoPatcher\elmcity.ini

What variable would be used for the drive letter?

Q2: When ever I open the batch file from the AP share on the server

\\Server\AutoPatcher

The first thing I get is this error

CMD.EXE was started with the above path as the current directory.

UNC paths are not supported. Defaulting to Windows directory.

no big deal, the next step works anyways - but is there a way to get rid of this?

Do you run it from C: instald of the share

Hi,

As an option, you can use a .CMD file directly from the share or a remote drive using the following code:

 @echo off
 pushd %~dp0
 autopatcher
 popd

Place this in a .CMD file and place it in the same folder as autopatcher.exe.

The %~dp0 code means "My Expanded Drive and Path" e.g the path to the .CMD file itself.

This means the code is portable to any folder without being changed.

The only fly in the ointment here is that the .CMD window will not change to the working directly if the path is in a UNC path. However the code will still run anyway.

There is a Registry fix for this issue; when I locate the settings I will update my posting.

Kind Regards

Simon

Appreciate the support ... still getting error. I will try to clarify more....

I d-click ap.bat (code below) from here \\server\AutoPatcher

pushd \\Server\AutoPatcher

pause

autopatcher.exe /noeula

popd \\Server\AutoPatcher

FYI same thing happens when I d-click ap2.bat (code below) from here \\server\AutoPatcher

pause

pushd %~dp0

pause

autopatcher /noeula

popd

Here's the error - I think it's just from running a BATCH file from a unc path - pushd %~dp0 works nicely!!!

'\\Server\AutoPatcher'

CMD.EXE was started with the above path as the current directory.

UNC paths are not supported. Defaulting to Windows directory.

C:\WINDOWS>pushd \\Server\AutoPatcher\

Y:\>pause

Press any key to continue . . .

OH can anyone answer my first question?

Q1: In wanting to use a /defaults ini like:

/noeula /defaults:C:\AutoPatcher\elmcity.ini => /noeula /defaults:???\AutoPatcher\elmcity.ini

What variable would be used for the drive letter?

- Thank You - Thank You - Thank You - Thank You - Thank You - Thank You -

Ah ha! No longer getting "UNC paths are not supported" error

Found this reg tweak at http://www.ss64.com/nt/cmd.html

;Allow UNC paths at command prompt

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor]

"DisableUNCCheck"=dword:00000001

still need help here:

Q1: In wanting to use a /defaults ini like:

/noeula /defaults:C:\AutoPatcher\elmcity.ini => /noeula /defaults:???\AutoPatcher\elmcity.ini

What variable would be used for the drive letter?

Also ... anyone have a reference for directory commands between percentage marks???

like %system32%

and PsiMoon314 where did you find %~dp0 !!!

Ah ha! No longer getting "UNC paths are not supported" error

Found this reg tweak at http://www.ss64.com/nt/cmd.html

;Allow UNC paths at command prompt

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor]

"DisableUNCCheck"=dword:00000001

I'd guess this prevents the check, which would prevent the "error" from appearing only. Still a good find though. ;-)

still need help here:

Q1: In wanting to use a /defaults ini like:

/noeula /defaults:C:\AutoPatcher\elmcity.ini => /noeula /defaults:???\AutoPatcher\elmcity.ini

What variable would be used for the drive letter?

Also ... anyone have a reference for directory commands between percentage marks???

like %system32%

and PsiMoon314 where did you find %~dp0 !!!

@PsiMoon: truly a good find, that %~dp0. @Rgabriele, google it and you'll find several sources of info on what it is and does. From Loren Halvorson's Blog : Silly batch file tricks, redirecting stdout into an evironment variable and %~dp0

Since I'm on the topic of useful/(or useless?) batch file tricks, another little known one I find myself using alot is the "%~dp0" macro which resolves to the fully expanded path to the directory containing the batch file. This allows batch files to run regardless of the current working directory.

Based on this, I'd probably be experimenting with not having a path at all....

/noeula /defaults:elmcity.ini

or

/noeula /defaults:.\elmcity.ini maybe?

Let us know how you make out!

You nailed rtk

DisableUNCCheck prevents the check, which would prevent the "error" from appearing only

So no real need to bother with the DisableUNCCheck, since it works either way

This is simple and works - maps, runs from anywhere, and then disappears - cool!

pushd %~dp0

autopatcher /noeula /defaults:elmcity.ini

popd

Thanks for the environment variables links ... was looking all over w/o any luck

Here's a microsoft link ... same info

http://www.microsoft.com/resources/documen...w.mspx?mfr=true

  • 3 weeks later...

I'd just like to point out that cmdow.exe is detected as a 'Hacker Tool' by some anti-virus programs. I love to run AP from a central server when doing updates on collegues machines but having a 'Hacker Tool' installed didn't go over so well with some of them (at least until I had a chance to explain). Mostly Norton does this (ugh Norton...) and describes it as "A tool used to hide command windows and run secret commands" or something similar. Regardless of what it is I just thought I'd point this out before it happens to someone else. There were two solutions I tried, the first was to add a DEL command to the end of the batch file to remove cmdow.exe from the system root, but that didn't always work (seems Norton likes to lock and quarantine the file without notifying me). The second option use this as the first line of the batch file instead:

@\\ComputerName\AutoPatcher\cmdow.exe @ /hid

None of the antivirus programs seem to care at all about this (probably because they don't scan unmapped network shares) so it all works out for the best.

Hi Guys,

I am glad that the %~dp0 info worked for you :D

This sort of .CMD code has been used for a while when making Windows PE / BartPE based boot CD's and the plugins that this uses.

Here are some others you can use:

@echo off
setlocal enableextensions
cls
echo.
echo	 I am file (not yet expanded):		 %0
echo	 My Expanded File Name:				%~n0
echo	 My Expanded Extension:				%~x0
echo	 My Expanded Name and Extension:	   %~nx0
echo	 My Expanded Drive:					%~d0
echo	 The Expanded Root of My Drive:		%~d0\
echo	 Some Other Expanded Path on My Drive: %~d0\SomeOtherPath
echo	 My Expanded Path:					 %~p0
echo	 My Expanded Drive and Path:		   %~dp0
echo	 My Expanded full filename and path	%~f0
echo	 My Expanded short filename path	   %~dps0
echo.

These others might come in useful for other projects. I use this code as a reference. Pop it into a .CMD file and run it to see the output.

Kind Regards

Simon

  • 6 months later...
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • AB Download Manager 1.9.1 by Razvan Serea AB Download Manager is an open-source, feature-rich download manager designed to accelerate downloads, organize files efficiently, and provide seamless control over downloads. With support for multiple connections, resume capability, and an intuitive interface, it enhances the downloading experience for users seeking speed and reliability. The software integrates with various browsers, enabling quick link grabbing and batch downloading. It supports HTTP, HTTPS, and FTP protocols, ensuring broad compatibility with different file sources. Users can schedule downloads, set speed limits, and categorize files automatically for better organization. AB Download Manager is lightweight yet powerful, making it a great alternative to proprietary download managers. Its open-source nature allows developers to contribute, customize, and improve the software as needed. Whether you're downloading large files, managing multiple downloads at once, or seeking an ad-free experience, this tool offers a practical and efficient solution. Key features of AB Download Manager: Multi-Connection Support – Accelerates downloads by splitting files into multiple segments. Resume Capability – Allows paused or interrupted downloads to be resumed without starting over. Batch Downloading – Supports downloading multiple files at once for improved efficiency. Browser Integration – Captures download links directly from browsers for seamless operation. HTTP, HTTPS, and FTP Support – Ensures compatibility with a wide range of file sources. Download Scheduling – Enables users to automate downloads at specific times. Speed Limiting – Lets users control bandwidth usage for optimized performance. File Categorization – Automatically organizes downloaded files into designated folders. User-Friendly Interface – Simple and intuitive design for easy navigation. Cross-Platform Compatibility – Works on multiple operating systems. Ad-Free Experience – No intrusive ads or tracking for a clean user experience. AB Download Manager 1.9.1 changelog: Added An option to customize notification sounds (#1259) Fixed Ongoing notification was laggy on Samsung One UI devices (#1269) Improved Updated Translations Minor UI/UX improvements Download: AB Download Manager 1.9.1 | Portable | ~80.0 MB (Open Source) Download: ARM64 | Portable ARM64 | Android Links: AB Download Manager Website | Github Page | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • watching him because of the Mr Klinton cat
    • yup dude, ADS on this website are terrible
    • Samsung Galaxy Z Fold 8, Flip 8, Z Fold Wide: Everything you need to know The ONLY thing I need to know is the price, which I know will be way higher than I (and most people) are willing to pay for a phone... so basically nothing here I need to know. PS: Nice job getting that Apple reference to a non-existent and unrevealed product as "competition" in there. Cheque is in the mail.
  • Recent Achievements

    • Week One Done
      rolfus earned a badge
      Week One Done
    • One Month Later
      Leroy Jethro Gibbs earned a badge
      One Month Later
    • Conversation Starter
      flexorcist earned a badge
      Conversation Starter
    • One Month Later
      AndreaB earned a badge
      One Month Later
    • One Month Later
      agatameier earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      505
    2. 2
      +Edouard
      196
    3. 3
      PsYcHoKiLLa
      140
    4. 4
      ATLien_0
      90
    5. 5
      Steven P.
      81
  • Tell a friend

    Love Neowin? Tell a friend!