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

    • As I've been usually saying lately - we all can thank "AI" for this.
    • Friday Windows 11 preview builds are here. Insiders in the Experimental (formerly Dev) and Beta Channel can download builds 26300.8697 and 26220.8690. My Windows11 device on the Preview Channel just got 26220.8728. My guess is this build is a nightly update from 26220.8690.
    • Traffic has a surprisingly unexpected impact on your surroundings by Sayan Sen Image by Radik 2707 via Pexels A collaborative study by researchers from several Israeli institutions found that everyday pollution from traffic and industrial activity measurably changed the atmospheric electric field over the Tel Aviv metropolitan area, providing new evidence of how human activity can influence the lower atmosphere. The research was led by Dr. Roy Yaniv of the Hebrew University of Jerusalem and the Gertner Institute at Sheba Medical Center, Dr. Assaf Hochman of the Fredy & Nadine Herrmann Institute of Earth Sciences at the Hebrew University, and Prof. Yoav Yair of Reichman University. The study also involved Itay Froomer, a student from Hadera High School and the Israeli Museum of Medicine and Science (Technoda), who carried out the work as part of the Ministry of Education's 5-unit physics research track. The researchers focused on the atmospheric electric field under fair-weather conditions. Even in the absence of storms, a weak electric field naturally exists between Earth's surface and the atmosphere. One of the main ways scientists measure this field is through the Potential Gradient (PG), which is the inverse of the vertical component of the electric field. PG is a key part of the global electric circuit, a planet-wide system of electrical currents maintained by thunderstorms and electrified clouds around the world. Scientists have long known that the atmospheric electric field can be influenced by factors ranging from large-scale atmospheric processes to local weather conditions such as dust, fog and clouds. Human-made pollution is also known to play a role, but understanding exactly how urban emissions affect the electric field close to the ground has remained an area of ongoing research. To investigate this relationship, the team analyzed measurements from a newly installed electric field mill, an instrument used to continuously monitor the strength of the atmospheric electric field. The instrument was installed at the Center for Technological Education (Roter House) in Holon and became operational in August 2024. It was funded by Israel's Ministry of Education and the Holon municipality. The electric field mill forms part of a broader monitoring network that includes nearby meteorological stations and air-quality monitoring sites. This allowed researchers to compare electric field measurements with detailed weather data and pollution records to better understand what was driving changes in the Potential Gradient. The study focused on two major urban pollutants: fine particulate matter (PM2.5) and nitrogen oxides (NOx), both commonly produced by vehicle traffic and industrial activity. PM2.5 refers to microscopic airborne particles small enough to remain suspended in the atmosphere for extended periods, while NOx is a group of gases released during fuel combustion. Researchers examined daily, weekly and seasonal patterns in the atmospheric electric field and compared them with changes in pollutant concentrations. Their analysis revealed a clear relationship between NOx levels and changes in the Potential Gradient, particularly during morning and evening rush hours when traffic emissions were at their highest. “What we observe is a direct physical link between emission peaks and electrical variability,” explained Dr. Roy Yaniv. “NOx reduces atmospheric conductivity very quickly, so the electric field responds almost instantaneously during traffic rush hours.” Atmospheric conductivity describes how easily electrical charges move through the air. According to the researchers, nitrogen oxides rapidly alter this conductivity, causing a near-immediate response in the electric field. PM2.5, however, was associated with a delayed response. The researchers attributed this difference to the particles' longer atmospheric residence time, meaning they remain in the atmosphere for longer periods, as well as their different microphysical interactions with surrounding air and atmospheric components. The study also identified a pronounced "weekend effect." In Israel, traffic volumes and some industrial activity decline significantly on Fridays and Saturdays. During these periods, concentrations of both NOx and PM2.5 dropped, and corresponding changes were observed in the atmospheric electric field. “The weekend signal demonstrates just how sensitive the electric field is to changes in human activity,” the researchers noted. “When emissions decline, the electrical environment adjusts at once, providing a high-resolution indicator of urban atmospheric conditions.” The findings showed that pollution levels can influence not only the chemical composition of the atmosphere but also its electrical properties. Researchers said the results strengthened the case for using atmospheric electricity as an additional tool for environmental monitoring, particularly in densely populated urban areas where anthropogenic, or human-caused, influences are most pronounced. The study also pointed to potential public health applications. By combining air-quality measurements with observations of atmospheric electricity, researchers said they could gain a more complete picture of how urban atmospheric conditions change over time. “Integrating air-quality data with electric-field measurements gives us a clearer picture of how the lower atmosphere evolves moment by moment,” the researchers added. “It’s a framework that can support both scientific insight and practical environmental decision-making.” Beyond the scientific findings, the project highlighted a collaboration between universities, public institutions and secondary education. Researchers said the work demonstrated how students could take part in real-world environmental research while contributing to studies of air quality, atmospheric processes and their potential effects on society. Source: Hebrew University, ScienceDirect This article was generated with some help from AI and reviewed by an editor. Under Section 107 of the Copyright Act 1976, this material is used for the purpose of news reporting. Fair use is a use permitted by copyright statute that might otherwise be infringing
    • We aren't even at the all-star game and Microsoft is talking about an update that will most likely be released during the World Series if not after. A lot can happen in the world between now and the 2026 World Series, including the 2026 FIFA Cup. Tell me about it again after the FIFA Cup is concluded. That should allow plenty of time to prepare for it.
    • Great, tell me when I have a "Bad Pool Caller" elsewhere not in Windoze.
  • Recent Achievements

    • Week One Done
      AMV earned a badge
      Week One Done
    • One Month Later
      AMV earned a badge
      One Month Later
    • Collaborator
      ryansurfer98 went up a rank
      Collaborator
    • One Month Later
      Eurosoft10 earned a badge
      One Month Later
    • Week One Done
      Eurosoft10 earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      542
    2. 2
      +Edouard
      186
    3. 3
      Michael Scrip
      77
    4. 4
      PsYcHoKiLLa
      77
    5. 5
      Steven P.
      71
  • Tell a friend

    Love Neowin? Tell a friend!