Skip to main content

Error on Powershell - 0xffff0000

I am not very familiar with PowerShell, yet... really. Currently, my main scripting language is VBScript. However, I am truly believe the needs to learn PowerShell is keep increasing every single day. Server 2008 and Server 2012 are equiped with PowerShell, some advanced managements in XenDesktop 7.5 are using PowerShell, it is fun to learn PowerShell (they said), and a few other points mentioned by my colleagues (Wow, what on earth Heiry, why your introduction is longer than an episode of Dads?)

Issues :

Error encountered when a scheduled task created to run PowerShell script :


The shell cannot be started. A failure occurred during initialization: Object reference not set to an instance of an object.


Furthermore, this error reported on Task Scheduler.






Troubleshooting 
  1.  Go to Start > Run, and type regedit. Press Enter

  2.  Registry Editor launched. Browse to My Computer > HKEY_CURRENT_USER, and look for for Environment folder. It is not there.

  3.  Next, go to My Computer > right click and choose Properties

  4.  Go to Advanced tab, and click at Environment Variables...

  5.  You won't see any entry on variable, as below :


Resolution :

There are 2 methods to solve this :-


Method 01 - Using Registry Editor :

  1.  Launch REGEDIT. Browse to My Computer > right click at HKEY_CURRENT USER > hover at New > Choose Key

  2.  Change the new Key name to Environment

  3.  Now, lets refresh Registry Editor by pressing View > Refresh

  4.  We can see the new key is arranged accordingly.

  5.  Next, rignt click at Environment key > go to New > choose Expandable String Value

  6.  Right click at newly created strign entry, and choose Rename and name it as TMP

  7.  Right click at TMP string, and choose Modify

  8.  Configure below string to Value data box :
    String :
    %USERPROFILE%\Local Settings\Temp
                   
  9. Perform step 5 until 8 with below info : 
String Name : TEMP
Value Data : %USERPROFILE%\Local Settings\Temp




Method 02 - Using GUI :

  1. Right Click at My Computer > choose Properties > click at Advanced Tab > Click at Environment Variables

  2.  We will add the strings from here. Choose New

  3.  Configure the variable names and variable values accordingly, then press OK
     Variable name :
    TMP
     Variable Value : %USERPROFILE%\Local Settings\Temp

     Variable name : TEMP
     Variable Value : %USERPROFILE%\Local Settings\Temp
                                                                     
  4. This is the outcome. Press OK, and launch the PowerShell script to test.

Comments

  1. Hi Heiry,

    All the image links were broken. Could you please help to fix it?

    Thanks

    ReplyDelete
    Replies
    1. Hi there,

      Sure thing! I accidentally deleted those pictures in Google Photos but worry not, I am pretty sure I have another copy in Word documents, so it is doable!

      Delete

Post a Comment

Popular posts from this blog

Session Settings Not Listed in Citrix Web Interface web site.

In previous post , I mentioned on what need to be done by users in case the publsihed applications did not successfully launched in seamless mode. However, in some cases, users might not be able to see the option. This post will help to solve it. Issues : Session Settings preference is not listed in Citrix Web Interface web site. This is due to the option is not enabled. It can be checked at Citrix Web Interface Management Console. Troubleshooting   Launch Citrix Web Interface Management Console . Browse to Citrix Web Interface > XenApp Web Sites . You will see lists of created Sites.  Right click at the required farm URL.  Choose S e ssion Preference  This window will appeared. Browse to Remote Connnection > Display . You will see the option " Allow users to customize window size " is unchecked . Resolution : Check the option " Allow users to customize window size ", and press OK  Get users to refresh the Web

How To Change NetBIOS Name of A Computer

So yes... After 4 months without new contents, so I started with this. It looks easier to do (well, it is), but before you do that, you may want to read this  to understand the difference between hostname and netBIOS, then starts to explore on when to use them, their limitations etc etc. I won't discuss here (or maybe not today). So let's back to the topic.   Description : Changing NetBIOS Name of A Computer. ComputerName : NetBIOS : How To Do :  Go to Start > Run , and type REGEDIT  Browse to Computer > HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > Control > ComputerName > ComputerName At the right side, double click at ComputerName string, and put correct Value data . Press OK .  Then you will get this Reboot your computer / VM. Once it is up, double check your netBIOS name. New name shall be reflected

Microsoft Assessment and Planning (MAP) Toolkit - Extract Report (3/4)

As mentioned in  the first post , this KB series is about Microsoft Assessment and Planning (MAP) Toolkit. There are 4 main steps : Install MAP Toolkit and its basic configuration Collect inventory Data  Extract Report Extract Advanced Report Once inventory data collected, we can generate reports. From the inventory data collected earlier, we can use options in the toolkit to generate the report. For this example, we re going to discover Windows 10 Readiness This KB is about  how to generate report from collected inventory data. At Overview page, select the targeted scenario category. In this example, it is Desktop . At this page, select specific scenario that we after. In this example, it is Windows 10 Readiness.     It is possible to customize assessment properties. The properties will set the threshold of the assessment, such as, threshold for minimum CPU speed, acceptable free disk, as well as minimum assigned RAM. To do so, select Customize assessment pr