Windows 8 and 8.1 Forums


Batch file question

  1. #1


    Posts : 9
    Windows 8

    Batch file question


    Hi,

    I'm writing a small batch file, but it doesn't show everything. Can you help?
    Code:
    @echo offsetLocal EnableDelayedExpansion
    pushd "C:\Users\%username%\Desktop"
    type nul > "%hostname% %username%"
    I also want to add IP-address (and maybe leave the username out).

    Jvuz

      My System SpecsSystem Spec

  2. #2


    Harrisonburg, Va.
    Posts : 10,488
    Windows 8.1.1 Pro with Media Center


    Quote Originally Posted by jvuz View Post
    Hi,

    I'm writing a small batch file, but it doesn't show everything. Can you help?
    Code:
    @echo offsetLocal EnableDelayedExpansion
    pushd "C:\Users\%username%\Desktop"
    type nul > "%hostname% %username%"
    I also want to add IP-address (and maybe leave the username out).

    Jvuz
    Have you tried this--

    https://www.google.com/#hl=en&tbo=d&...w=1366&bih=643
      My System SpecsSystem Spec

  3. #3


    West Auckland
    Posts : 107
    Windows 8 Pro Pack x64


    What is the purpose of this batch file?
      My System SpecsSystem Spec

  4. #4


    Posts : 9
    Windows 8


    Creating a shortcut with simple info (hostname and if possible IP-address)
      My System SpecsSystem Spec

  5. #5


    West Auckland
    Posts : 107
    Windows 8 Pro Pack x64


    Quote Originally Posted by jvuz View Post
    Creating a shortcut with simple info (hostname and if possible IP-address)
    I though so.

    You're better off with some piece of software to do that, like Rainmeter. It may be hipster software and ridiculously hard to get it looking just the way you want, but it's the way to go.

    Or you can just set yourself a static IP address, which is what I do.

    Having a file created and automatically named with your current IP address may be a bit much to ask. It will NEVER happen if you're wanting your outside (WAN) IP address.
      My System SpecsSystem Spec

  6. #6


    West Auckland
    Posts : 107
    Windows 8 Pro Pack x64


    Quote Originally Posted by medab1 View Post
    You had might as well have answered with this:

    To Answer Your Question... - YouTube
      My System SpecsSystem Spec

  7. #7


    Posts : 9
    Windows 8


    With this code
    Code:
    @echo offsetLocal EnableDelayedExpansion
    pushd "C:\Users\%username%\Desktop"
    type nul > %computername%
    I have the most important: computername. Which may be enough.
    Thanks for the help.

    @medab1: Thanks for pointing me to that Google site. I didn't know something like that existed :P
    No, seriously. I already searched there, but didn't find it immediately what I needed. I also know Bginfo, I've even used that one, but I wanted something small. Because I wanted some help into the right direction I asked it here, because it's a forum and I thought it was a place to help people, not to ridicule people. But that's my opinion. No hard feelings though.

    jvuz
      My System SpecsSystem Spec

Batch file question
Related Threads
I'm trying to create a NETSH batch file that sets my TCP/IP settings to DHCP. The line I want to use is: netsh interface ipv4 set address name="My Custom Named Network" dhcp If I run the global cmd prompt and paste this line, it works as intended. However, if I create a batch file with the...
Need Batch File Help in General Support
First off, sorry if this is not posted in the right forum. I wasn't sure if it was more appropriate here or in the "Chillout Room" or elsewhere. I'm a noob when it comes to batch scripts, so I'd appreciate any help I could get. I tried doing all sorts of searches to find my answer (at least one...
Solved EFS encryted file question in General Support
I am experimenting with a password reset tool. It says that once you reset the password, the EFS Encrypted files will be unreadable. I have read about EFS and am still confused. I am going to reset the password for 3 PCs in an office because no one there has a clue as to what the passwords...
I accidentally set the file open of .bat files to Notepad. From a link in this forum (How to Restore Default File Extension Type Associations in Windows 8 and 8.1)was able to reset the registry back I think. The bat file not longer asks for notepad but instead opens "How do you want to open this...
I need a way to play a video constantly all day, I found the following batch file which when edited for my video works perfectly in both Chrome and Firefox but does not work in Internet explorer(IE) Does any one have a solution for IE please. The Batch file is as follows:- <!DOCTYPE html> <html>...
If anyone is interested, I made a tutorial on using a batch file to run dism & sfc. https://www.eightforums.com/windows-updates-activation/40095-windows-update-wont-download-sfc-finds-corrupt-cant-fix-2.html#post336782 I hope it is useful to someone. :)
Since Windows 8 is not creating System Restore points, apparently because I have a dual boot Windows 8 / Windows 7 setup, I'd like to schedule one every 3-4 days or so. Is there any way to run system restore from Command line or batch file or Powershell? If so then I could schedule it to run...
Eight Forums Android App Eight Forums IOS App Follow us on Facebook