Windows 10: Can you help me run this PS1 from a batch

Discus and support Can you help me run this PS1 from a batch in Windows 10 Performance & Maintenance to solve the problem; Hello. I want to make this ps1 script execute from an batch file : It's named "enable-all-advanced-power-settings.ps1" Enable all advanced power... Discussion in 'Windows 10 Performance & Maintenance' started by vigan1, Aug 29, 2020.

  1. vigan1 Win User

    Can you help me run this PS1 from a batch


    Hello.
    I want to make this ps1 script execute from an batch file :
    It's named "enable-all-advanced-power-settings.ps1"
    Enable all advanced power settings in Windows. . GitHub

    Code:
    I put "enable-all-advanced-power-settings.ps1" in the same folder as my .bat.
    My batch file contain this code, but the ps1 script need more priviledges to run :

    Code:
    But I can't get it to work, when I run the .bat as administrator or not !
    Powershell is launched, but it can't run, here's a photo :
    https://i.stack.imgur.com/51Wd8.png

    Can someone try it on their system or tell me how to do it ?
    Thank you.

    :)
     
    vigan1, Aug 29, 2020
    #1

  2. Is schedule job running DisableUnusedSmb1.ps1 normal?

    Dears,

    Recently I found a schedule job running on my Windows 10 version 1809 machines.

    It is trying to run powershell with the following parameters. Is this normal?

    -ExecutionPolicy Unrestricted -NonInteractive -NoProfile -WindowStyle Hidden

    C:\Windows\system32\WindowsPowerShellv1.0\Modules\SmbShare\DisableUnusedSmb1.ps1 -Scenario Server

    Thank you and Regards,

    Leo
     
    Leo Leung (leo.leung), Aug 29, 2020
    #2
  3. phrab Win User
    Syntax for Batch file &/or powershell script to run multiple commands

    Thanks for your reply & suggestion. I'm able to get Powershell to run as admin. But I don't know the syntax for the batch file.

    I tried:

    Code:
    but that doesn't work.
     
    phrab, Aug 29, 2020
    #3
  4. djmcnz Win User

    Can you help me run this PS1 from a batch

    running DOS as ADMIN

    I assume you don't have 'exit' anywhere in your batch file?

    Rather than playing with 'pause' - if you want to see the output...

    1. Open a command window as admin
    2. Run the batch file manually
    3. Command window will not close unless the 'exit' command is issued
    4. Read output
    That's the first step I'd take to diagnose. Then run every line in your batch file manually, one-by-one, in your admin command window (copy and paste from the actual batch file, don't retype the commands).

    You'll soon find your problem.
     
    djmcnz, Aug 29, 2020
    #4
Thema:

Can you help me run this PS1 from a batch

Loading...
  1. Can you help me run this PS1 from a batch - Similar Threads - help run PS1

  2. can you help me?

    in Windows 10 Software and Apps
    can you help me?: there is a problem in my pc i download a game i keep getting a black screen for a few seconds when i launch it then the game closes and nothing happens https://answers.microsoft.com/en-us/windows/forum/all/can-you-help-me/9e758dbf-228f-4149-a4ac-7054bf26e1b7
  3. can you help me

    in Windows 10 Customization
    can you help me: I changed my display in bios to UEFI from legacy in hopes to enable secure boot but it never worked, now when I turn my pc off and on my screen is black https://answers.microsoft.com/en-us/windows/forum/all/can-you-help-me/078300b5-113d-4fe6-b8aa-611b20f2af5c
  4. Can you help me?

    in Windows 10 Gaming
    Can you help me?: I'm trying to install Virtualbox from Oracle and getting this message. But I'm unsure if you can help me because it is not a Microsoft product. If you can't, then just let me know.Look forward to hearing your response....
  5. can you help me?

    in Windows 10 Drivers and Hardware
    can you help me?: ,My mouse is not working. When ı put usb wireless to computer, the computer is not seeing the mouse. Can we change the usb port? https://answers.microsoft.com/en-us/windows/forum/all/can-you-help-me/1bb3aaea-202b-4937-b055-8ad4def598b9
  6. can you help me?

    in Windows 10 Software and Apps
    can you help me?: **** off i dont want your onedrive **** on my computer**** off i dont want your onedrive **** on my computer**** off i dont want your onedrive **** on my computer**** off i dont want your onedrive **** on my computer**** off i dont want your onedrive **** on my computer****...
  7. can you help me with this?

    in Windows 10 Software and Apps
    can you help me with this?: I asked many questions here :https://answers.microsoft.com/en-us/windows/forum/all/i-can-t-fix-issues-with-my-graphics-card/2f5e31b2-b780-4497-937b-2bb4055a3984?page=1but nothing worked."display driver stopped responding and has recovered. Display driver AMD driver stopped...
  8. Can you help me :/

    in AntiVirus, Firewalls and System Security
    Can you help me :/: Hello there,Today, when I enter my Windows Defender, I get an error like you see in the screen image. What is the solution of this ?, I cannot do any windows defender operation / I cannot shut down [ATTACH]...
  9. Can you help me ?

    in Windows 10 Ask Insider
    Can you help me ?: My PC Specs : I7 9700K (water cooled) (overclocked to 5GHZ) RTX 2080 TI 64 GB RAM DDR4 3200MHZ 4TB HHD 500 GB Samsung EVO 970 My problem is that i just installed Windows 10 Pro and when my computer tries to boot it does not find my Samsung Evo(where the Windows is...
  10. Can you help me?

    in Windows 10 Installation and Upgrade
    Can you help me?: i cant find the SCENES command from Format for 3d models..please help me to enable it[ATTACH] https://answers.microsoft.com/en-us/windows/forum/all/can-you-help-me/cd7f5b75-00ab-43cb-813c-20fe3f325924