Search found 30 matches

by Docfxit
12 Jul 2019 11:40
Forum: DOS Batch Forum
Topic: Calling a bat file with a parameter
Replies: 3
Views: 840

Re: Calling a bat file with a parameter

Ok. So it's not working. I would like to get it working.
Yes I would like to automatically choose option one.
Do you know how to get it to accept option one on the next re-boot?

Thanks,
Docfxit
by Docfxit
11 Jul 2019 10:57
Forum: DOS Batch Forum
Topic: Calling a bat file with a parameter
Replies: 3
Views: 840

Calling a bat file with a parameter

I'm trying to call a bat file with a parameter. The bat file does get called. The parameter doesn't. Set "RunFile=IPAddressSet.bat 1" REG ADD "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /V "Set IP Address" /t REG_SZ /F /D "%~dp0%RunFile%" This is the bat file I am calling: @ECHO off cal...
by Docfxit
02 Apr 2019 09:52
Forum: DOS Batch Forum
Topic: Ipconfig doesn't work inside a bat file
Replies: 18
Views: 1740

Re: Ipconfig doesn't work inside a bat file

I changed it to this: @Echo Off echo. echo IP INFORMATION ipconfig/all | find "IP Address" ipconfig/all | find "IPv4 Address" ipconfig/all | find "Subnet Mask" ipconfig/all | find "Default Gateway" ipconfig/all | find "Host Name" ipconfig/all | find "DNS Suffix Search List" ipconfig/all | find "Phys...
by Docfxit
02 Apr 2019 09:02
Forum: DOS Batch Forum
Topic: Ipconfig doesn't work inside a bat file
Replies: 18
Views: 1740

Re: Ipconfig doesn't work inside a bat file

Things you still could try: - Run ping with the fully qualified path. That is, C:\Windows\System32\ping.exe. I have changed the bat file to this: @echo. @echo IP INFORMATION @ipconfig/all | find "IP Address" @ipconfig/all | find "IPv4 Address" @ipconfig/all | find "Subnet Mask" @ipconfig/all | find...
by Docfxit
01 Apr 2019 17:02
Forum: DOS Batch Forum
Topic: Ipconfig doesn't work inside a bat file
Replies: 18
Views: 1740

Re: Ipconfig doesn't work inside a bat file

I did run SFC /scannow. It did find problems. I did reboot. I ran SFC /scannow again. I received: Windows Resource Protection did not find any integrity violations. I did re-boot. I ran Winsock reset with: @Echo Off netsh winsock reset catalog netsh int ip reset resetlog.txt ipconfig /release ipconf...
by Docfxit
01 Apr 2019 09:38
Forum: DOS Batch Forum
Topic: Ipconfig doesn't work inside a bat file
Replies: 18
Views: 1740

Re: Ipconfig doesn't work inside a bat file

I changed it to Ping.exe. That didn't fix it. I noticed that machine has PROMPT=$P$G when I run SET in a cmd window. The other machine doesn't. I don't know if that might have something to do with it. I don't know where that comes from. It's not in the Environment Variables.

Docfxit
by Docfxit
31 Mar 2019 20:50
Forum: DOS Batch Forum
Topic: Ipconfig doesn't work inside a bat file
Replies: 18
Views: 1740

Re: Ipconfig doesn't work inside a bat file

This is the output I get:

Code: Select all

C:\Users\MyUserName>where ping
C:\Windows\System32\PING.EXE
Thanks,
Docfxit
by Docfxit
31 Mar 2019 20:11
Forum: DOS Batch Forum
Topic: Ipconfig doesn't work inside a bat file
Replies: 18
Views: 1740

Re: Ipconfig doesn't work inside a bat file

On the bad computer this is what I am getting now: IP INFORMATION IPv4 Address. . . . . . . . . . . : 192.168.168.7(Preferred) Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.168.168 Host Name . . . . . . . . . . . . : DocfxitLT Physical Address. . . . ....
by Docfxit
31 Mar 2019 20:06
Forum: DOS Batch Forum
Topic: Ipconfig doesn't work inside a bat file
Replies: 18
Views: 1740

Re: Ipconfig doesn't work inside a bat file

You are a genius. That fixed the find immediately. I removed "C:\Programs\cygwin\bin" out of the environment path since it has it's own Environment entry.
Thank you very much for finding the fix for me.

You're great,

Thanks,
Docfxit
by Docfxit
31 Mar 2019 14:43
Forum: DOS Batch Forum
Topic: Ipconfig doesn't work inside a bat file
Replies: 18
Views: 1740

Ipconfig doesn't work inside a bat file

When I run my batch file it shows me: IP INFORMATION find: 'IP Address': No such file or directory find: 'IPv4 Address': No such file or directory find: 'Subnet Mask': No such file or directory find: 'Default Gateway': No such file or directory find: 'Host Name': No such file or directory find: 'DNS...
by Docfxit
11 Mar 2019 18:52
Forum: DOS Batch Forum
Topic: Get PID from port
Replies: 5
Views: 911

Re: Get PID from port

I don't know what you are expecting. First of all you should enclose the search string into quotes for the findstr command. And instead of "80" you should rather look for ":80\>" where \> marks the right word boundary as explained in the help of findstr. For your command that would mean findstr ":%...
by Docfxit
11 Mar 2019 14:00
Forum: DOS Batch Forum
Topic: Get PID from port
Replies: 5
Views: 911

Re: Get PID from port

That fixed the error really great.

Do you have any idea why the port isn't being substituted in this code?

Code: Select all

set "Port#=80"
for /f "tokens=5" %%a in ('netstat -aon ^| findstr %Port#%') do tasklist /FI "PID eq %%a"
Thank you,
Docfxit
by Docfxit
11 Mar 2019 13:16
Forum: DOS Batch Forum
Topic: Suppress titile on CMD
Replies: 2
Views: 513

Re: Suppress titile on CMD

That's really super. I have been wanting that for years.

Thanks a bunch,

Docfxit
by Docfxit
11 Mar 2019 12:03
Forum: DOS Batch Forum
Topic: Suppress titile on CMD
Replies: 2
Views: 513

Suppress titile on CMD

I'd like to find a way to suppress the title when I use CMD. In a batch file I frequently use CMD at the end to stop the command window from closing. I like to see the command prompt at the end of the window. When I use: @cmd I get: Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft C...
by Docfxit
11 Mar 2019 11:54
Forum: DOS Batch Forum
Topic: Get PID from port
Replies: 5
Views: 911

Get PID from port

I have a syntax error when trying to get the PID from a port number:

Code: Select all

for /f "tokens=5" %a in ('netstat -aon ^| findstr 80') do tasklist /FI "PID eq %a"

Code: Select all

a" was unexpected at this time.
Thanks,
Docfxit