Sign in to follow this  
Followers 0
MattHiggs

Accessing files from temp directory

2 posts in this topic

#1 ·  Posted (edited)

I have run into a puzzling issue.  I am trying to download (or at least in this case "fileinstall") a file into the temp directory of the computer running the script and then run the file after it is in the temp directory.  Here is the code:

Spoiler

FileInstall ( "C:\Users\demon\Downloads\Windows6.1-KB2819745-x86-MultiPkg.msu", @TempDir & "\powershellx86.msu" )
    RunWait ( @ComSpec & " /c wusa.exe " & '"' & @TempDir & '\powershellx86.msu" /quiet /norestart', @SystemDir, @SW_SHOW )

However, when the code actually runs, the command prompt appears and then abruptly disappears without running the command.  To investigate this, I navigate to the temp folder (C:\user\demon\appdata\temp) the file is there and ready to be used.  Something seems to be wrong with the command, but if I were to change the macro from @tempdir to, say, @DesktopDir, then the command would run fine.

 any advice?

Edited by MattHiggs

Share this post


Link to post
Share on other sites



Never mind.  Figured it out.  Was testing script on VM with brand new windows 7 install and forgot that Windows update itself needs to be updated before it can be used.

Share this post


Link to post
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
Sign in to follow this  
Followers 0