batch-file

How to send email to distribution list in outlook using task scheduler?

拜拜、爱过 提交于 2020-05-14 09:13:33
问题 I went through numerous solutions for this but couldn't replicate for outlook DLs. I have below requirement. Create .bat file for testng.xml file and run using task scheduler at any prescribed time. This one I have done. Next is to send the testng report to outlook DLs. I am using a remote desktop which is being used by many users. How can I achieve that? I don't want to use sendEmail.exe file. Any suggestions please? Edits:- 1. I tried Send an email(Deprecated) which gives this error :- An

Batch file : skipping folders starting with _ in FOR loop

穿精又带淫゛_ 提交于 2020-05-14 07:07:08
问题 I would like to exclude all profiles starting with _ without having to list each profile in an exclusion text file. Is it possible to do this ? @echo off set Target=D:\backup for /f "tokens=*" %%I in ('dir /a:d-h /b "%SystemDrive%\Users\*"') do if exist "%Target%\%%~nXI\" ( ........ ) pause exit Thank you very much in advance for helping ! 回答1: The following code example provides a methodology for retrieving the profile names you require, (those which are not a special account and whose names

How to change directory with BAT file?

大憨熊 提交于 2020-05-14 03:41:08
问题 I would expect the below code to open up in the C:\Users\zjafri\Desktop\Arthur\Runner2 directory when running this bat file, but instead it opens up to my desktop directory. Does somebody have an idea why? %windir%\system32\cmd.exe "/K" C:\ProgramData\Anaconda3\Scripts\activate.bat C:\ProgramData\Anaconda3 CD C:\Users\zjafri\Desktop\Arthur\Runner2 The console output is: C:\Users\zjafri\Desktop>C:\windows\system32\cmd.exe "/K" C:\ProgramData\Anaconda3\Scripts\activate.bat C:\ProgramData

How to change directory with BAT file?

烂漫一生 提交于 2020-05-14 03:37:30
问题 I would expect the below code to open up in the C:\Users\zjafri\Desktop\Arthur\Runner2 directory when running this bat file, but instead it opens up to my desktop directory. Does somebody have an idea why? %windir%\system32\cmd.exe "/K" C:\ProgramData\Anaconda3\Scripts\activate.bat C:\ProgramData\Anaconda3 CD C:\Users\zjafri\Desktop\Arthur\Runner2 The console output is: C:\Users\zjafri\Desktop>C:\windows\system32\cmd.exe "/K" C:\ProgramData\Anaconda3\Scripts\activate.bat C:\ProgramData

Behavior of bat and Powershell is different when clicked vs run from respective consoles, specifically with git

一笑奈何 提交于 2020-05-14 02:26:42
问题 This post appears wordy, but there's actually not much here to read. Just figured more details > less details. I am working on some tools to speed up my git workflow. I found/modified a PowerShell script that attempts to update all git branches: function PullAllBranches() { $branches = git branch foreach($branch in $branches){ $fixedBranch = $branch.Substring(2, $branch.Length - 2) # extract actual name $trackedExpression = "branch." + $fixedBranch + ".merge" $trackedBranch = git config --get

Both display and save Plink output

假如想象 提交于 2020-05-14 01:06:12
问题 I'm logging into to a remote ssh session using plink.exe to perform certain tasks using a batch script. Getting the output of these commands in a log file as well on the screen is very important for me. I tried using usual batch way i.e. plink servername -m cmd.txt>logfile.log way but the problem with this is that it won't display it on the Windows terminal that the batch script is running on. Then I found the -sshlog option of Plink. This does the work, i.e. I can get the output but on

Both display and save Plink output

╄→гoц情女王★ 提交于 2020-05-14 01:02:22
问题 I'm logging into to a remote ssh session using plink.exe to perform certain tasks using a batch script. Getting the output of these commands in a log file as well on the screen is very important for me. I tried using usual batch way i.e. plink servername -m cmd.txt>logfile.log way but the problem with this is that it won't display it on the Windows terminal that the batch script is running on. Then I found the -sshlog option of Plink. This does the work, i.e. I can get the output but on

Set proxies via command line (windows)

倖福魔咒の 提交于 2020-05-12 11:04:06
问题 How to set proxy to each profile I have in waterfox via command line or script who do this automatically. I have 50 profiles by the way. This what I want to do but via cmd-line: 回答1: I don't know waterfox, but if it is similar to firefox the first lines in prefs.js state: > pushd "%APPDATA%\Mozilla\Firefox\Profiles\*.default" > more prefs.js // Mozilla User Preferences // DO NOT EDIT THIS FILE. // // If you make changes to this file while the application is running, // the changes will be

Set proxies via command line (windows)

不羁岁月 提交于 2020-05-12 11:03:21
问题 How to set proxy to each profile I have in waterfox via command line or script who do this automatically. I have 50 profiles by the way. This what I want to do but via cmd-line: 回答1: I don't know waterfox, but if it is similar to firefox the first lines in prefs.js state: > pushd "%APPDATA%\Mozilla\Firefox\Profiles\*.default" > more prefs.js // Mozilla User Preferences // DO NOT EDIT THIS FILE. // // If you make changes to this file while the application is running, // the changes will be

What does %%a mean? (Batch)

一个人想着一个人 提交于 2020-05-12 04:40:59
问题 What does the %%a mean? I understand the context but not how to use it. For example : FOR %%a in (%HELP%) DO echo I don't Know what it means 回答1: %%a refers to the name of the variable your for loop will write to. Quoted from for /? : FOR %variable IN (set) DO command [command-parameters] %variable Specifies a single letter replaceable parameter. (set) Specifies a set of one or more files. Wildcards may be used. command Specifies the command to carry out for each file. command-parameters