Windows 10: I need to run htpasswd from inside a batch script using a variables

Discus and support I need to run htpasswd from inside a batch script using a variables in Windows 10 Support to solve the problem; I have tried this every way i can think of. the batch is in the same folder as the .htaccess file to be modified. i can run the htpasswd file with -v... Discussion in 'Windows 10 Support' started by questorfla, Jan 15, 2020.

  1. I need to run htpasswd from inside a batch script using a variables


    I have tried this every way i can think of.
    the batch is in the same folder as the .htaccess file to be modified.
    i can run the htpasswd file with -v and -b which should allow for batch and give me a clue of what went wrong if it does
    i set a pause right after the statement runs
    statement exact is htpasswd -b %name% %password%
    next line types the .htaccess file to monitor and i can see the user and password have not been added
    As far as i can tell that is the correct format for the command to add a new name and password to an existing .htaccess
    Any advice appreciated but according to Apache I should be able to do this?
    the one error that does pop up says something like users 3ae24b (which was the correct value for the login)not found but there is no ask for the user's login
    the user's password is not mentioned.
    Should I put the username variable and password variable in quotes?
    How can i pipe this info into the htaccess file in batch using variable for the value of name and password


    At this point, i have tried so many variations i cant imagine but i am beginning to make typos so stopping for the night

    :)
     
    questorfla, Jan 15, 2020
    #1

  2. I need to run htpasswd from inside a batch script using a variables

    I have tried this every way i can think of.
    the batch is in the same folder as the .htaccess file to be modified.
    i can run the htpasswd file with -v and -b which should allow for batch and give me a clue of what went wrong if it does
    i set a pause right after the statement runs
    statement exact is htpasswd -b %name% %password%
    next line types the .htaccess file to monitor and i can see the user and password have not been added
    As far as i can tell that is the correct format for the command to add a new name and password to an existing .htaccess
    Any advice appreciated but according to Apache I should be able to do this?
    the one error that does pop up says something like users 3ae24b (which was the correct value for the login)not found but there is no ask for the user's login
    the user's password is not mentioned.
    Should I put the username variable and password variable in quotes?
    How can i pipe this info into the htaccess file in batch using variable for the value of name and password


    At this point, i have tried so many variations i cant imagine but i am beginning to make typos so stopping for the night
     
    questorfla, Jan 15, 2020
    #2
  3. yegorsw Win User
    Run the audio troubleshooter from a batch script

    I have an automated home theatre setup - a batch script that enables my TV as a display, and changes the TV to be my primary display (so games and apps open on my TV instead of my monitor).

    The same script also changes my default audio device to be the TV.

    The problem is every time I turn off my TV, it disappears from the list of audio output devices in Windows 10, and even when I turn it back on, it does not appear in the list. However, if I RIGHT CLICK on the audio icon and select "troubleshoot sound problems"
    and immediately cancel/close the troubleshooter, the TV is automagically added to my list of output devices.

    My question is - is there any way to have this troubleshooter be launched from a batch script and instantly closed? Alternatively, is there a way to force a refresh of the audio devices through a batch script?
     
    yegorsw, Jan 15, 2020
    #3
  4. I need to run htpasswd from inside a batch script using a variables

    Running PowerShell script as a batch file

    Hello Baldo,



    Thank you for writing to Microsoft Community Forums.



    I understand that you want to execute the PowerShell commands as a batch file.



    I tried executing the batch file on my machine but I was unable to execute it as the command was incomplete. However, after making some changes in the command I was able to execute the batch file.



    You can try the following command by saving it in a batch file and check if that helps.



    powershell –Command Get-AppxPackage Microsoft.3dBuilder | Remove-AppxPackage



    Also, as the query is related to running a PowerShell script using a batch file, I suggest you to post the issue on

    TechNet
    forums where we have professionals who have more knowledge about the issue.



    Hope it helps.



    Regards,

    Prakhar Khare

    Microsoft Community – Moderator
     
    Prakhar_Khare, Jan 15, 2020
    #4
Thema:

I need to run htpasswd from inside a batch script using a variables

Loading...
  1. I need to run htpasswd from inside a batch script using a variables - Similar Threads - need run htpasswd

  2. Need help on batch script to shutdown computers from list

    in Windows 10 Gaming
    Need help on batch script to shutdown computers from list: Hi, I would need help to write a bat file to shutdown all the computers listed in the text file. Can someone help me please?This script will extract the list of computers name from the text file and loop to shutdown each computer....
  3. Batch scripting

    in Windows 10 Software and Apps
    Batch scripting: Hi, here's the code that I used for 3 DISM commands to start automatically after pressing a key:Code and result:Code:@echo off echo You are going to use DISM. echo 1. To check the image. echo 2. Scan your PC's health echo 3. Restore your PC'S health. echo To continue, press...
  4. Batch scripting

    in Windows 10 Network and Sharing
    Batch scripting: Hi, here's the code that I used for 3 DISM commands to start automatically after pressing a key:@echo off echo You are going to use DISM. echo 1. To check the image. echo 2. Scan your PC's health echo 3. Restore your PC'S health. echo To continue, press any key. echo Before...
  5. Batch variables are not output?

    in Windows 10 Network and Sharing
    Batch variables are not output?: Hello everybody I have written the following script: @echo off setlocal enableDelayedExpansion :set/p again Z=Number of rows: set/p S=Number of columns: set/a Ze=%Z%+0 set/a Sp=%S%+0 if not %Z%==%Ze% ( cls echo error.. goto again) if %Z%==0 ( echo error... goto again )...
  6. Using variables with the rename command in a batch file

    in Windows 10 Network and Sharing
    Using variables with the rename command in a batch file: Hello, I am trying to use variables in renaming a robocopy log file but I continually receive a 'syntax error'. Everything works perfectly until I use the rename command. I am using the latest build of Windows 10. Any advice will be appreciated, thank you. The batch...
  7. Run the audio troubleshooter from a batch script

    in Windows 10 Drivers and Hardware
    Run the audio troubleshooter from a batch script: I have an automated home theatre setup - a batch script that enables my TV as a display, and changes the TV to be my primary display (so games and apps open on my TV instead of my monitor). The same script also changes my default audio device to be the TV. The problem is...
  8. Automatically Run Batch Script

    in Windows 10 Installation and Upgrade
    Automatically Run Batch Script: Hi everyone When the windows installation is finished, automatically run batch script. How can I do that? Thanks *Wink 122531
  9. Running PowerShell script as a batch file

    in Windows 10 Network and Sharing
    Running PowerShell script as a batch file: Can I run the Power Shell line: "C:\Windows\System32>get-appxpackage *3dbuilder* | remove-appxpackage" from a .Bat file? ***Original title: Removing bloatware***...
  10. Help needed writing batch script!

    in Windows 10 Support
    Help needed writing batch script!: Firstly thank you for even clicking on this thread as I understand that this probably isn't meant to be here. The scenario is that I'm trying to write a script that incorporates the result of a ping to an IP and then based on the result do different things. Here is an...