VFtOVQ/UofwRI_VoGI/AAAAAAAABpE/ys8EME5aZIU/s1600/registry.PNG' alt='Reg Add Hkey_Local_Machine Software Microsoft Windows Currentversion Runonce' title='Reg Add Hkey_Local_Machine Software Microsoft Windows Currentversion Runonce' />Autologon and Runonce Code Script. How To Install Peoplesoft Test Framework Message. Vbscript Operating System Autologon And Runonce. The following code set the appropriate registry keys to login automatically and run a program once on the next login. Windows 10 Forums the biggest Windows 10 help and support forum, friendly help and many tutorials that will help you get the most out of Microsofts latest Operating. In some cases, Active Setup may be the solution. It works by adding a key to HKLMSOFTWAREMicrosoftActive SetupInstalled Componentspackage name with a version. REG. exe. Read, Set or Delete registry keys and values, save and restore from a. REG file. Syntax REG QUERY ROOTRegKey v ValueName s REG QUERY ROOT. I need a vbscript that will notify me that there are pending Windows Updates on my machine. These are updates that are already downloaded and are waiting. This code runs on Server 2. Windows XP and Vista. Set obj. Shell WScript. Create. ObjectWScript. Shellstr. Username Adminstr. Password Password. Run. Once HKEYLOCALMACHINESoftwareMicrosoftWindowsCurrent. Registry_7.jpg' alt='Reg Add Hkey_Local_Machine Software Microsoft Windows Currentversion Runonce' title='Reg Add Hkey_Local_Machine Software Microsoft Windows Currentversion Runonce' />Jorgen, great article Quick question In regards to this registry key HKEYCURRENTUSERSOFTWAREMicrosoftWindowsCurrentVersionExplorerTaskband. VersionRun. Oncejoin. Domainobj. Shell. Reg. Write str. Run. Once, cmd. exe c cscript c installmyscript. REGSZstr. Auto. Logon HKEYLOCALMACHINESoftwareMicrosoftWindows NTCurrent. Versionwinlogonobj. Shell. Reg. Write str. Auto. Logon Auto. Admin. Logon, 1, REGDWORDobj. Shell. Reg. Write str. Auto. Logon Default. User. Name, str. Username, REGSZobj. Shell. Reg. Write str. Auto. Logon Default. Password, str. Password, REGSZPlease note that a disclaimer applies to any code on this page. Deployment Mad Scientist Bending software to my will. Welcome to part two of a five part series on deploying runtimes and reader from Adobe with an app store like experience using Microsoft System Center Configuration Manager. Todays episode Shockwave Player As I prepared to write, I asked myself, Does anyone use Shockwave anymore It turns out that the answer is pretty much a no, but Im going to stick with my plan to cover Shockwave, Flash, AIR, and Acrobat Reader in that order for completeness. Also, Shockwave is the only one of the four that is actually packaged appropriately by the vendor for an acceptable user experience, so it makes sense to cover it first so we can focus on the plumbing of building the application package. Each of these programs receives frequent updates, and it can be quite a task to build new application packages every few weeks. As I have mentioned previously, there are vendors that will take care of this for you, and I encourage you to use one of them if you can afford it and if it makes sense in your organization. My approach here will be to show a do it yourself method for automating app package creation for these frequent updates using Windows Power. Shell. Prerequisites. To follow along, you will need to have distribution rights from Adobe, Power. Shell 5. 0, and the Configuration Manager cmdlets. See my previous blog post for details. You may not technically need Power. Shell 5. 0, but thats what I have. Im not going to make any effort to ensure that what Im doing works on previous versions, so to make sure everything below works for you, I suggest upgrading to version 5. You can check your version of Power. Shell from a Power. Shell prompt by displaying PSVersion. Table. PSVersion. Heres the command and its output from my Windows 1. Power. Shell 5. 0 installed. PS C PSVersion. Table. PSVersion. Major Minor Build Revision. PSC PSVersion. Table. PSVersion. Major Minor Build Revision 5 0 1. Using Power. Shell for Packaging First Iteration. Lets begin by outlining the plan in comments. Well start with a simple, single use script and then refine it later. Download the Shockwave installer from Adobe. Extract the version information from the installer. Save the installer to the appropriate location. Extract the program icon. Create the application object in Configuration Manager. Download the Shockwave installer from Adobe Extract the version information from the installer Save the installer to the appropriate location Extract the program icon Create the application object in Configuration Manager Downloading. There are several ways to download a file from the web with Power. Shell. Im going to choose the simplest one which may not be the best one, depending on your criteria a built in Power. Shell cmdlet called Invoke Web. Request. Start by clicking the Shockwave link you received from Adobe. In the Shockwave Player Distribution Downloads table, right click the Download MSI Installer link, and choose Copy shortcut or its equivalent to copy it to the clipboard. Paste the URL into the Power. Shell script and assign it to a variable. This will be important later. Basically, were going to use Invoke Web. Request to download the file to a temporary folder. Unfortunately, things are never as easy as they sound. The download link provided by Adobe does not include a filename, but Invoke Web. Request needs one in order to save the file. It is important to me, at least to use the real filename of the file rather than something arbitrary. Also, the link provided by Adobe redirects elsewhere, which complicates matters. Here is the somewhat scary looking code, and an explanation follows. Download the Shockwave installer from Adobe. Uri Shockwave download URI. We dont know the installers filename, so generate a temporary one until the file is downloaded. Web. Response. Object. Out. Filename System. IO. Path Get. Random. File. Name. temp. Out. File. Path env TEMPtemp. Out. Filename. Download the installer and save it to a temporary location and filename. The Pass. Thru switch puts a Web. Response. Object in the pipeline in addition to writing the file. Invoke Web. Request Uri Uri Out. File temp. Out. File. Path Pass. Thru. Get the filename from the Web. Response. Object. Filename System. IO. Path Get. File. Nameresponse. Base. Response. Response. Uri. Absolute. Uri. If the target file already exists, delete it. If the file does not exist, Remove Item returns an error, so ignore errors. File. Path env TEMPout. Filename. Remove Item Path out. File. Path Force Error. Action Ignore. Rename the temporary file with its proper name. Rename Item Path temp. Out. File. Path New. Name out. Filename. Remove zone identifier. Unblock File Path out. File. Path. 1. 23. Download the Shockwave installer from AdobeUri Shockwave download URI We dont know the installers filename, so generate a temporary one until the file is downloaded and we can get the filename from the Web. Response. Object. Out. FilenameSystem. IO. Path Get. Random. File. Nametemp. Out. File. Pathenv TEMPtemp. Out. Filename Download the installer and save it to a temporary location and filename. The Pass. Thru switch puts a Web. Response. Object in the pipeline in addition to writing the file. Invoke Web. Request UriUri Out. Filetemp. Out. File. Path Pass. Thru Get the filename from the Web. Response. Object. FilenameSystem. IO. Path Get. File. Nameresponse. Base. Response. Response. Uri. Absolute. Uri If the target file already exists, delete it. If the file does not exist, Remove Item returns an error, so ignore errors. File. Pathenv TEMPout. FilenameRemove Item Pathout. File. Path Force Error. Action. Ignore Rename the temporary file with its proper name. Rename Item Pathtemp. Out. File. Path New. Nameout. Filename Remove zone identifier. Unblock File Pathout. File. PathObviously, replace the URI placeholder text with the appropriate download link from Adobe. Since that link does not include the filename, we generate one with a call into the. NET Frameworks System. IO. Path. Get. Random. Filename function. Next, we use Invoke Web. Request to download the file to a temporary folder. The Invoke Web. Request cmdlet puts its result on the pipeline as a Web. Response. Object unless you pass the Out. File parameter, in which case it puts nothing on the pipeline. The Pass. Thru switch overrides this behavior and puts the response object on the pipeline in addition to writing the output file. This object, which is captured by the response variable, contains the actual URI used to obtain the downloaded file after any redirects were followed. The System. IO. Path. Get. File. Name function extracts just the filename from this URI. We delete any existing file with the same name in the temporary folder and then rename the downloaded file with the proper name. Finally, we remove the zone identifier from the downloaded file with Unblock File in order to prevent security prompts when attempting to install the program later. For more information on this, see About URL Security Zones on Tech. Net. Scott Hanselman also has a great discussion of the zone identifier alternate data stream from 2. Power. Shell cmdlet we will use, so maybe it did not yet exist back then. Extracting Version Information.