Search found 951 matches

by ShadowThief
07 May 2020 08:09
Forum: DOS Batch Forum
Topic: Read file1 and remove the lines in that file from file2
Replies: 8
Views: 683

Re: Read file1 and remove the lines in that file from file2

findstr has a /G flag that takes in a file which contains a list of strings to search for, so you can use

Code: Select all

findstr /V /G:file1 %windir%\system32\drivers\etc\hosts >hosts2
move hosts2 %windir%\system32\drivers\etc\hosts
by ShadowThief
28 Apr 2020 09:42
Forum: DOS Batch Forum
Topic: help! how to compress file
Replies: 2
Views: 869

Re: help! how to compress file

%PATH% is a system variable and it holds the location of every important file on your computer. Please don't overwrite that value and definitely don't delete anything from it.
by ShadowThief
20 Apr 2020 08:19
Forum: DOS Batch Forum
Topic: How to disable Avast until reboot
Replies: 7
Views: 1213

Re: How to disable Avast until reboot

I don't have Avast installed, but assuming the executable is called avast.exe, it should be as simple as

Code: Select all

taskkill /f /im avast.exe
and running that as an Administrator (to prevent the "Access Denied" error). Of course, if there are additional processes, you'll need to taskkill those as well.
by ShadowThief
18 Apr 2020 12:07
Forum: DOS Batch Forum
Topic: Changing settings with .bat
Replies: 4
Views: 1264

Re: Changing settings with .bat

They're probably in the registry somewhere. Unfortunately, you haven't told us which settings you're looking to change, so I recommend just searching Google for "regedit" and then whatever setting you want, like "regedit wallpaper fit" or whatever.
by ShadowThief
17 Apr 2020 17:56
Forum: DOS Batch Forum
Topic: command prompt in windows 10
Replies: 37
Views: 16733

Re: command prompt in windows 10

Squashman wrote:
17 Apr 2020 16:55
ShadowThief wrote:
17 Apr 2020 15:46
I knew we had gotten curl and ssh, but tar is a nice surprise
I found TAR and CURL but I don't have SSH.
I think you have to enable it under Apps & Features -> Optional Features
by ShadowThief
17 Apr 2020 15:46
Forum: DOS Batch Forum
Topic: command prompt in windows 10
Replies: 37
Views: 16733

Re: command prompt in windows 10

I knew we had gotten curl and ssh, but tar is a nice surprise
by ShadowThief
17 Apr 2020 11:02
Forum: DOS Batch Forum
Topic: Searching a pattern in a website using curl in cmd
Replies: 12
Views: 1807

Re: Searching a pattern in a website using curl in cmd

I've never seen findstr called that way before, and findstr /? shows findstr search_string file_name . >"out.txt" curl "https://www.foobar.com/" >nul findstr /c:"search me" out.txt && echo found || echo not found Step two, of course, is to open out.txt with a text editor and make sure that the thing...
by ShadowThief
08 Apr 2020 13:53
Forum: DOS Batch Forum
Topic: can you do this batch ocrrectly for me please
Replies: 7
Views: 1572

Re: can you do this batch ocrrectly for me please

You had it correct the first time with netsh interface ipv4 set dnsservers "Conexión de red inalámbrica" static 8.8.8.8 primary netsh interface ipv4 add dnsservers "Conexión de red inalámbrica" 8.8.4.4 netsh interface ipv6 set dnsservers "Conexión de red inalámbrica" static 2001:4860:4860::8888 prim...
by ShadowThief
06 Apr 2020 17:43
Forum: DOS Batch Forum
Topic: Run PSEXEC
Replies: 9
Views: 1142

Re: Run PSEXEC

Code: Select all

taskkill /IM UpdateMacrium.exe
If it's running, it gets killed. If it's not running, you get an error message and nothing else happens. You can even stick a 2>nul at the end of the code if you don't want the error message.
by ShadowThief
05 Apr 2020 23:28
Forum: DOS Batch Forum
Topic: Run PSEXEC
Replies: 9
Views: 1142

Re: Run PSEXEC

The code isn't broken, you just never gave it the PID to search for. As written, the script expects two arguments: the application name as it appears in tasklist and the PID of the running task, in that order.
by ShadowThief
04 Apr 2020 13:30
Forum: DOS Batch Forum
Topic: Copy CD contents with CD name
Replies: 16
Views: 1649

Re: Copy CD contents with CD name

And from where should a batch code read the CD name? And if it would be able to do so, what should happen if it contains characters that are invalid in the file system? Steffen Wouldn't it be the volume label? for /f "tokens=1-5,*" %%A in ('vol D:^| find "Volume in drive"') do set "disc_name=%%F"
by ShadowThief
04 Apr 2020 09:45
Forum: DOS Batch Forum
Topic: Weird Issue, unless i'm overlooking it?
Replies: 1
Views: 689

Re: Weird Issue, unless i'm overlooking it?

Is there a line in Email_Utility.ps1 to create a file?
by ShadowThief
15 Mar 2020 06:06
Forum: DOS Batch Forum
Topic: @Echo off is not working when Piping batch code to cmd
Replies: 8
Views: 1705

Re: @Echo off is not working when Piping batch code to cmd

That's fair, if you could put the script on the machine that the code needed to run on, you wouldn't need to download it with curl and pipe it to cmd... In that case, I can recommend a two-part solution: curl vaido.world -o runme.bat && call runme.bat Or a three-part solution if you want to clean up...
by ShadowThief
15 Mar 2020 04:31
Forum: DOS Batch Forum
Topic: @Echo off is not working when Piping batch code to cmd
Replies: 8
Views: 1705

Re: @Echo off is not working when Piping batch code to cmd

Then I suggest you write a wrapper script that takes the URL you're downloading as %1 and pipes that to cmd /q
by ShadowThief
15 Mar 2020 04:18
Forum: DOS Batch Forum
Topic: @Echo off is not working when Piping batch code to cmd
Replies: 8
Views: 1705

Re: @Echo off is not working when Piping batch code to cmd

Why don't you want to use cmd /Q? That's how you do it.