Search found 442 matches

by orange_batch
30 Dec 2011 17:33
Forum: DOS Batch Forum
Topic: why is this FOR doing this?
Replies: 22
Views: 20052

Re: why is this FOR doing this?

Use start cmd /k cd /d C:\
by orange_batch
26 Dec 2011 19:23
Forum: DOS Batch Forum
Topic: making the Windows mouse cursor temporarily dissappear?
Replies: 5
Views: 9630

Re: making the Windows mouse cursor temporarily dissappear?

I would think the software would do it automatically. Batch cannot hide a mouse cursor directly. As a work-around, you might try writing a script which modifies the file that binds that mouse state to that cursor icon, and changing it to something blank (same as using the control panel utility would...
by orange_batch
26 Dec 2011 19:19
Forum: DOS Batch Forum
Topic: How to send a message to other computers of the LAN?
Replies: 3
Views: 5534

Re: How to send a message to other computers of the LAN?

net send /? I'm not sure but the required service may be disabled or made LAN only. I remember early versions of Windows XP had the messenging service enabled by default, and users would receive spam from bots broadcasting crap to wide IP address ranges. I think it also allowed a security hole for ...
by orange_batch
23 Dec 2011 15:07
Forum: DOS Batch Forum
Topic: Piped input and output to a batch file
Replies: 18
Views: 21707

Re: Piped input and output to a batch file

Sorry, you're right about piping specifically, but your code echoes the file names with the prefix and suffix (not modifying the contents). What I mean is, it's possible to do what he asked using batch. Jason, your code is a little wonky so I'll post a complete solution. This will overwrite your inp...
by orange_batch
23 Dec 2011 14:12
Forum: DOS Batch Forum
Topic: Piped input and output to a batch file
Replies: 18
Views: 21707

Re: Piped input and output to a batch file

Squashman, that is incorrect...

Jason, working with the output of any command always involves for /f "..." %%a in ('...') do ....

Code: Select all

for /f "delims=" %%a in ('dir /b') do call "append.bat" prefix suffix "%%a"
by orange_batch
22 Dec 2011 23:45
Forum: DOS Batch Forum
Topic: Copy file with specific extension if it is equal to today
Replies: 1
Views: 2618

Re: Copy file with specific extension if it is equal to toda

I would help more, but please do some manual research. http://ss64.com/nt/xcopy.html

Type this into the console.

xcopy /?

What you're looking for is the /d switch, among others.
by orange_batch
22 Dec 2011 23:41
Forum: DOS Batch Forum
Topic: copy mulitiple files an once
Replies: 4
Views: 4682

Re: copy mulitiple files an once

Copy the directory, not the individual files.
by orange_batch
22 Dec 2011 23:38
Forum: DOS Batch Forum
Topic: Need to learn more
Replies: 1
Views: 2677

Re: Need to learn more

I suggest Googling for a tutorial and using m and m. The syntax is provided for you on commands: Syntax CACLS pathname [options] So, something like cacls "C:\path..." /P %username%:RWC if syntax, single line: if 1==1 echo Hello Else: if 1==1 ( ) else ( ) Multiple conditions: if 1==1 if 2==...
by orange_batch
21 Dec 2011 23:56
Forum: DOS Batch Forum
Topic: Get last string after delimiter FOR /F
Replies: 3
Views: 11691

Re: Get last string after delimiter FOR /F

The above works for backslash as a delimiter, but the following works for whatever else: call :getlasttoken "what#is#the#last#token" echo %lasttoken% pause exit :getlasttoken set "check=%~1" :loop if defined check ( for /f "delims=# tokens=1*" %%x in ("%check%"...
by orange_batch
21 Dec 2011 20:19
Forum: DOS Batch Forum
Topic: batch file every second Alt+F3
Replies: 2
Views: 4481

Re: batch file every second Alt+F3

It's'a ease'ay...

http://msdn.microsoft.com/en-us/library ... dkeys.aspx

presskey.vbs

Code: Select all

set a=wscript.createobject("wscript.shell")
a.sendkeys "%{F3}"

DOS:

Code: Select all

cscript presskey.vbs //nologo
by orange_batch
20 Dec 2011 17:37
Forum: DOS Batch Forum
Topic: why is this FOR doing this?
Replies: 22
Views: 20052

Re: why is this FOR doing this?

I would recommend undoing any registry changes and removing the initialization batch, and instead load command prompt using a script. start cmd /k cd /d "C:\" Personally I put single letter scripts into my user directory, so I just type x or y or z to initialize different settings. This co...
by orange_batch
20 Dec 2011 16:33
Forum: DOS Batch Forum
Topic: why is this FOR doing this?
Replies: 22
Views: 20052

Re: why is this FOR doing this?

C:\WINDOWS\system32>for /f "tokens=*" %f in ('cd') do @ECHO %f C:\WINDOWS\system32 C:\WINDOWS\system32>ver Microsoft Windows XP [Version 5.1.2600] C:\WINDOWS\system32> Hmm... try "delims=" instead of "tokens=*" ? Does typing just cd output C:\ ? I know this may be spec...
by orange_batch
20 Dec 2011 15:22
Forum: DOS Batch Forum
Topic: Strange behavior
Replies: 4
Views: 4612

Re: Strange behavior

Implementation of what !k said: @echo off setlocal enabledelayedexpansion :: zero leading (ex. 1 --> 001, 2 -->002, ...., 99 --> 099...) if exist m.txt del m.txt set "z=000" set n=111 set counter=1 :loop if %counter% leq %n% ( set "m=%z%%counter%" set "v=!m:~-3!" echo.!...
by orange_batch
20 Dec 2011 09:03
Forum: DOS Batch Forum
Topic: SET Command
Replies: 7
Views: 6689

Re: SET Command

But Dave, if all %%A are quoted, text within FileList is never exposed anyway.

These repeated explanations of delayed expansion are becoming tiring huh, we should just have a thread to link to. :P