Search found 82 matches
- 05 Nov 2011 13:59
- Forum: DOS Batch Forum
- Topic: Strange Issue With REG
- Replies: 3
- Views: 4068
Strange Issue With REG
Hello, I'm getting a strange issue with the REG command. If I run the REG command from a batch file, regardless of the syntax, the file will freeze, causing me to have to Control-C my way out, press the red X multiple times, or end the CMD.EXE processes from Task Manager. If I press the red X, the f...
- 30 Oct 2011 16:38
- Forum: DOS Batch Forum
- Topic: make batch file that write another file [solved]
- Replies: 2
- Views: 4199
Re: make batch file that write another file
Make the first occurrence of ">>" be ">". This means that it will make the file, instead of append to a file that does not exist. It doesn't matter if the file doesn't exist, both ">" and ">>" will create the file if it doesn't exist. By the way, this is a ba...
- 27 Oct 2011 16:05
- Forum: DOS Batch Forum
- Topic: Help Explaining %1, %2, etc.
- Replies: 2
- Views: 2854
Re: Help Explaining %1, %2, etc.
Thank you! I was not aware that the CALL command's help menu had this information.
- 26 Oct 2011 17:23
- Forum: DOS Batch Forum
- Topic: Help Explaining %1, %2, etc.
- Replies: 2
- Views: 2854
Help Explaining %1, %2, etc.
Hello,
I am curious about what the variables %1-%9 mean/do in a batch file. I understand that %0 is the name of the file, but that's about it.
Thanks for any help!
I am curious about what the variables %1-%9 mean/do in a batch file. I understand that %0 is the name of the file, but that's about it.
Thanks for any help!
- 13 Oct 2011 15:37
- Forum: DOS Batch Forum
- Topic: adding commands to cmd
- Replies: 10
- Views: 8001
Re: adding commands to cmd
There is no sensible way to tell even an expert how to "fix it". You have not said what you did and what you want to fix. You failed to give a relevant link to "AlleyPuppy's post", and on a hunch I looked at m and used Firefox Search but found no "system32". You have b...
- 12 Oct 2011 15:32
- Forum: DOS Batch Forum
- Topic: FOR /F Delimiter Question
- Replies: 2
- Views: 3082
Re: FOR /F Delimiter Question
This is easily solved using * representing the remainder of the line, disregarding any delimiters. @ECHO OFF SET NTWK=\\computer1\folder1$\folder2 FOR /F "TOKENS=1,* DELIMS=\" %%a IN ('ECHO %NTWK%') DO SET "HOST=%%a" & set "SHARE=%%b" ECHO HOST=%HOST% ECHO SHARE=%S...
- 11 Oct 2011 19:05
- Forum: DOS Batch Forum
- Topic: FOR /F Delimiter Question
- Replies: 2
- Views: 3082
FOR /F Delimiter Question
Hello, I have a question about delimiters in a FOR /F loop. I'm trying to extract the host name and share name from a previously specified network path (\\server\share). I can extract the server/host name using the following command: SET NTWK=\\computer1\folder1$ FOR /F "TOKENS=1 DELIMS=\"...
- 09 Oct 2011 09:25
- Forum: DOS Batch Forum
- Topic: How to add commands to cmd
- Replies: 2
- Views: 3523
Re: How to add commands to cmd
You can create batch files that do specific things and then place them in the System32 folder. For instance, you can create a command that deletes your internet cookies by making a batch file that contains something like this: @ECHO OFF IF EXIST "%APPDATA%\Microsoft\Windows\Cookies" (PUSHD...
- 08 Oct 2011 21:15
- Forum: DOS Batch Forum
- Topic: Check If Network Share Exists
- Replies: 2
- Views: 4408
Re: Check If Network Share Exists
' You may ping a computer and if you have the rights you are allowed to see the share. If you lack the rights you will be prompted to logon ! C:\PROFSYS\ADMIN>net view \\192.168.1.14 Gedeelde bronnen op \\192.168.1.14 Sharenaam Type Gebruikt als Opmerking -------------------------------------------...
- 04 Oct 2011 18:37
- Forum: DOS Batch Forum
- Topic: Check If Network Share Exists
- Replies: 2
- Views: 4408
Check If Network Share Exists
Hello. I am trying to figure out if a network share exists through CMD. I had a few ideas of how to do this, but all seem to fail. First I tried C:\>IF EXIST \\[computername]\[share[$]] ECHO Exists but this does not work. Then I tried connecting to just the computer (no share name) using NET USE and...
- 29 Sep 2011 21:20
- Forum: DOS Batch Forum
- Topic: Redirection Question
- Replies: 3
- Views: 3641
Re: Redirection Question
Ed Dyreen wrote:'
That would be great, I tried something similar in the past:Code: Select all
> "file.TMP" echo.This Works
< "file.TMP" set /p $str=
echo.$str=%$str%_
Hmmm... that works, but what if the command prompts you to do something? It is only shown after the command completes.
- 29 Sep 2011 21:12
- Forum: DOS Batch Forum
- Topic: Host name via batch file
- Replies: 5
- Views: 5484
Re: Host name via batch file
Oops! Sorry, I meant host name, not hist name. And since the two computers aren't on the same network, you cannot use the host name because the host name is used in LAN environments only. If you want to connect to your work computer from home, just use LogMeIn (m). It's basically Remote Desktop for ...
- 29 Sep 2011 15:31
- Forum: DOS Batch Forum
- Topic: Host name via batch file
- Replies: 5
- Views: 5484
Re: Host name via batch file
Do you mean use the host name instead of the IP Address to connect to a computer? You can use the hist name instead of the IP Address.
And two computers cannot have the same host name on the same network.
And two computers cannot have the same host name on the same network.
- 29 Sep 2011 10:05
- Forum: DOS Batch Forum
- Topic: Host name via batch file
- Replies: 5
- Views: 5484
Re: Host name via batch file
I know this works on Windows XP. If you are using Windows Vista/7 andd it doesn't work, post a reply and I'll fix it.
Code: Select all
for /f "tokens=16" %%a in ('ipconfig /all ^| find "Host Name"') do set HOSTNAME=%%a
- 28 Sep 2011 22:09
- Forum: DOS Batch Forum
- Topic: Redirection Question
- Replies: 3
- Views: 3641
Redirection Question
Is it possible to redirect the output of a command to a file and still read the output of the command in the CMD window as it's executing? I know you can redirect output using [command] > [file] or [command] >> [file] but it always nullifies the output on the screen. Thanks for any help!