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. Batch scripting problems

    in Windows 10 Ask Insider
    Batch scripting problems: So i found a bug. In batch scripting, I can only store 3 variables. I don't know the cause for this. Here's the code, if you need it. @ echo off title Elevator OS by Lackmey on YouTube and Reddit set gdata=No data found (this one works) set 1data=No data found (this one...
  3. 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...
  4. Task scheduler simply refuses to run a batch script

    in Windows 10 Customization
    Task scheduler simply refuses to run a batch script: I know that there have been many different solutions to this problem posted on the internet and various forums, but I have scoured Google for a solution to my problem to no avail. My problem appears to be unique (something that at this rate I do not want). Now, onto my...
  5. Unable to uninstall OneDrive from Domain computer using a batch script

    in Windows 10 Customization
    Unable to uninstall OneDrive from Domain computer using a batch script: Hi Legends, Requirement: One drive should be uninstalled from user profiles by logon script. I hope everyone knows that one drive is getting installed in user profile from the setup available in "Systemroot/syswow or system32/onedrivesetup.exe". I am trying to uninstall...
  6. 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
  7. 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***...
  8. 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...
  9. PowerShell Scripting - Run a Script from Shortcut

    in Windows 10 Tutorials
    PowerShell Scripting - Run a Script from Shortcut: How to: PowerShell Scripting - Run a Script from Shortcut [img] Information One of many PowerShell security features is that you can't run a script simply by double clicking it's icon on desktop or in a folder. Doing so will by default open script in Notepad for editing...
  10. Batch script question

    in Windows 10 Support
    Batch script question: Hello, I want make a batch script to delete a spefic folder on the C disk, but how can I get only that spefic folder? I got this: Code: FOR /D %%p IN ("C:\USERS\%USERNAME%\Downloads\*.*") DO rmdir "%%p" /s /q cd C:\USERS\%USERNAME%\Downloads\ del *.* /q /s timeout /t 5...