Search found 1158 matches

by ShadowThief
31 Oct 2022 19:15
Forum: DOS Batch Forum
Topic: Batch To Delete Shortcut on Desktop
Replies: 2
Views: 2343

Re: Batch To Delete Shortcut on Desktop

If it's a shortcut, it almost certainly has the .lnk extension (that's a lowercase L, not a capital i) and you have extensions turned off so you can't see it.
by ShadowThief
26 Oct 2022 17:41
Forum: DOS Batch Forum
Topic: Another way to keep terminal window open
Replies: 2
Views: 2095

Re: Another way to keep terminal window open

Simply run the script from the command prompt instead of double-clicking it and the window will stay open after the script ends.

You're new, so I'll oversimplify - never ever double click scripts!
by ShadowThief
25 Oct 2022 04:53
Forum: DOS Batch Forum
Topic: need to add header and add a formula
Replies: 6
Views: 2886

Re: need to add header and add a formula

You're going to want VBA for this. Batch can't help with Excel.
by ShadowThief
25 Oct 2022 03:41
Forum: DOS Batch Forum
Topic: need to add header and add a formula
Replies: 6
Views: 2886

Re: need to add header and add a formula

How do you know which "formula" goes with which column? It feels completely arbitrary.
by ShadowThief
19 Oct 2022 13:24
Forum: DOS Batch Forum
Topic: I can't see the var from an echo
Replies: 14
Views: 5179

Re: I can't see the var from an echo

You may have to map the remote server to a network drive first.

Code: Select all

net use Z: \\192.168.168.7\

if not exist "%FileName%" (
	set "file=!file!!lf!   ?    %FileName%"
	xcopy /y /f "Z:\Dnload\VNC\%FileName%" "%wkdir%"
	IF NOT ERRORLEVEL 1 GOTO FileCopied
)
by ShadowThief
07 Oct 2022 15:30
Forum: DOS Batch Forum
Topic: net use map SharePoint drive not working
Replies: 1
Views: 1496

Re: net use map SharePoint drive not working

All of the solutions I'm finding on google have you adjust timeout settings in the registry. Since I highly doubt that you have write access to the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters\LmhostsTimeout key, try using the IP address instead of the URL.
by ShadowThief
01 Oct 2022 09:47
Forum: DOS Batch Forum
Topic: i need a batch to find the 1st level of dir name and the 2nd
Replies: 2
Views: 1795

Re: i need a batch to find the 1st level of dir name and the 2nd

%PATH% is already a system variable, so you should call it something else. After that, you can simply delimit the string on \ and grab the second and third tokens. @echo off set "full_path=M:\11 11\22 22\33 33\44 44\A B C D.txt" for /f "tokens=2,3 delims=\" %%A in ("%full_path%") do ( set "top_leve...
by ShadowThief
30 Sep 2022 21:54
Forum: DOS Batch Forum
Topic: Batch File To Highlight All Files In Folder with Specific File Name
Replies: 10
Views: 3286

Re: Batch File To Highlight All Files In Folder with Specific File Name

Both src and dst are the full paths to the folders, so the script can be anywhere you want. %variable% is how you reference variables in batch, so you have to use %src% and %dst% instead of src and dst. %userprofile% is a system variable that already exists, so you don't need to worry about that. If...
by ShadowThief
21 Aug 2022 13:37
Forum: DOS Batch Forum
Topic: Kill process with batch
Replies: 1
Views: 1658

Re: Kill process with batch

How do you know you're passing the correct executable name to taskkill? Does it appear in tasklist?
by ShadowThief
11 Aug 2022 15:31
Forum: DOS Batch Forum
Topic: Using ASCII fonts and block elements for text messages - problem with encoding of BAT file
Replies: 4
Views: 2726

Re: Using ASCII fonts and block elements for text messages - problem with encoding of BAT file

A) You're correct to save the file as UTF-8, but the default code page used by the command prompt is 437, which is a non-UTF DOS OEM character set. In order to use Unicode, you need to add the line chcp 65001 >nul . B) In general, for loops play nicest with ANSI encoding, but if you aren't processin...
by ShadowThief
02 Aug 2022 15:04
Forum: DOS Batch Forum
Topic: Unable to taskill some cmd.exe instances
Replies: 3
Views: 2678

Re: Unable to taskill some cmd.exe instances

Take a look at the output of taskkill /?

Code: Select all

TASKKILL [/S system [/U username [/P [password]]]]
         { [/FI filter] [/PID processid | /IM imagename] } [/T] [/F]
/IM must be immediately followed by the imagename, and /T is separate from it
by ShadowThief
11 Jul 2022 09:05
Forum: DOS Batch Forum
Topic: Batch to create an ping and tracert log
Replies: 2
Views: 2723

Re: Batch to create an ping and tracert log

Just stick a >>file.txt after each command to add the output to file.txt. ping google.com >>file.txt tracert google.com >>file.txt You can also stick the redirection in front of the command. >>file.txt ping google.com >>file.txt tracert google.com You can also use parentheses if you don't want to ty...
by ShadowThief
07 Jul 2022 15:55
Forum: DOS Batch Forum
Topic: Hide a zip file inside an image
Replies: 2
Views: 6569

Re: Hide a zip file inside an image

Amanullah3456 wrote:
01 Jul 2022 05:52
Type "copy /b IMAGEFILE. jpg+ZIPFILE. ...
They weren't asking a question, and their syntax is correct. Copy uses the format

Code: Select all

copy source destination
by ShadowThief
14 Jun 2022 18:14
Forum: DOS Batch Forum
Topic: How to clear global variables when launching cmd from within a batch?
Replies: 6
Views: 4036

Re: How to clear global variables when launching cmd from within a batch?

All child instances inherit the environment of their parents. If you don't want a variable to exist inside of a child instance, you'll have to unset the variable before you spawn the child process.
by ShadowThief
13 Jun 2022 12:01
Forum: DOS Batch Forum
Topic: How to put path with blanks into "for" command? Masking & quotes
Replies: 9
Views: 5065

Re: How to put path with blanks into "for" command? Masking & quotes

I feel like I've seen this before and I had to

Code: Select all

for /F "Tokens=*" %%G in ('call "D:\some\path\with blanks inside\myprog.exe" -p "......" %1') do set "....."
in order to actually get it working but I can't find where I used it