Solve PowerShell Issues Quickly with Expert Help

  • Thread starter Thread starter Nate Duong
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around troubleshooting issues with a PowerShell script intended to change the desktop background on different versions of Windows 7. Participants explore compatibility problems between 32-bit and 64-bit systems, execution policies, and methods for running scripts.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Experimental/applied

Main Points Raised

  • Nate Duong reports that a PowerShell script worked on a 32-bit Windows 7 system but fails on a 64-bit version, prompting a request for assistance.
  • Some participants suggest that the issue may stem from using a 32-bit DLL on a 64-bit system and inquire about the availability of a 64-bit version.
  • Borg mentions that the script runs fine when executed directly in PowerShell but encounters issues when run from a .bat file.
  • Another participant asks if Borg has tried running the .bat file as an administrator, to which Borg confirms that the same error persists.
  • A participant notes that the incorrect security policy may be set on the computer and suggests changing the execution policy to unrestricted.
  • Links to external resources are provided for further information on PowerShell versions and setting up rotating backgrounds.

Areas of Agreement / Disagreement

Participants express differing views on the cause of the issue, with some attributing it to the 32-bit vs. 64-bit compatibility and others suggesting security policy settings. The discussion remains unresolved, with no consensus on the solution.

Contextual Notes

Participants reference specific error messages and execution methods, but the exact nature of the errors and the context of the PowerShell script's functionality are not fully detailed. There is also a lack of clarity regarding the definitions of the security policies mentioned.

Nate Duong
Messages
125
Reaction score
4
Dear Group,
I am trying to use powershell to automatically change desktop back ground,

I had code and it worked (windows7 with 32 bit), but when I tried to put into different computer (windows7 with 64 bit) the code did not work and it showed the message. (images 1a and 1b below),

Do you have any ideal to help me out? I also have an image which code is included?
1a.JPG
1b.JPG
1c.JPG

Thank you,

Nate Duong.
 
Computer science news on Phys.org
Your code shows that you're attempting to use a 32 bit dll on your 64 bit system. Do you have a 64 bit version that you can use instead?
 
Borg said:
Your code shows that you're attempting to use a 32 bit dll on your 64 bit system. Do you have a 64 bit version that you can use instead?
Borg,
If I do not have it, how can I download powershell version with 64 bit?
 
Borg said:
Your code shows that you're attempting to use a 32 bit dll on your 64 bit system. Do you have a 64 bit version that you can use instead?
Actually, when I right click and choose option "run with powershell". the software is run fine.

But when I created .bat file such as:

@Echo off
powershell.exe C:\Users\ngoc\Desktop\FINDER_PGM\ChangeDesktopOffice.ps1
cd c:\finder_pgm\radarcmd_finder
copy office.rdf default.rdf

the CMD window showed up and showed that message.

Do you have any ideal?

Thank you, Borg
 
Nate Duong said:
Actually, when I right click and choose option "run with powershell". the software is run fine.

But when I created .bat file such as:

@Echo off
powershell.exe C:\Users\ngoc\Desktop\FINDER_PGM\ChangeDesktopOffice.ps1
cd c:\finder_pgm\radarcmd_finder
copy office.rdf default.rdf

the CMD window showed up and showed that message.

Do you have any ideal?

Thank you, Borg
Have you tried running the .bat file as an administrator?
 
Borg said:
Have you tried running the .bat file as an administrator?
yes, I have tried with administrator, it showed the same message.
 
Then I'm not sure what the answer is. I haven't worked much with the power shell tools. I tried a simple Google search and ran across this article on Power Shell Versions. You do need to take care with respect to the 32 and 64 bit operating systems.
 
  • Like
Likes   Reactions: Imager

Similar threads

  • · Replies 13 ·
Replies
13
Views
3K
Replies
18
Views
9K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
1
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K