语句错误信息记录脚本的预期结束 [英] Expected end of statement error Info logging script

查看:350
本文介绍了语句错误信息记录脚本的预期结束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是我的脚本

echo Log In %DATE% at %TIME% with %USERNAME% FROM %COMPUTERNAME% >> \\CORONA\SHARE2\TYLER\"IP DIR"\IPS.TXT
IPCONFIG |FIND "IP" > \\CORONA\SHARE2\TYLER\"IP DIR"\IPS.TXT

基本上,我需要有这样我们的网络上。我会成立这个每次运行任务序列中......我们的域的用户登录

Basically I need to have this on our network. I will have a task sequence set up to run this every time a user on our domain logs in...

我需要它来记录文件中的 ips.txt (不一定是这个名字,它可以是任何东西,不过位置是它需要)
需要登录的IP地址,日期,时间,哪个用户和从什么计算机

I need it to log in the document ips.txt (doesn't have to be that name, it can be anything. the location however is where it needs to be) Needs to log the IP, the date, the time, which user, and from what computer.

有什么建议?我得到了行错误1焦炭10。

Any suggestions? i get the error in line 1 char 10.

推荐答案

下面是获取本地计算机的IPv4和IPv6连接的IP addesses以及网关IP地址的方法。

Here is a method to get IP addesses of the local machine's connection for IPv4 and IPv6 as well as gateway IP address.

@echo off
 WMIC NICConfig where "IPEnabled='True'" get Description, IPAddress, IPSubnet, DefaultIPGateway /value|FIND "="
pause

由于大卫在他的评论中指出的,你可以使用坪%计算机%但是这给我的Windows 8.1的机器上的IPv6地址。

As David noted in his comment you can use ping %computername% but this gives the IPv6 address on my Windows 8.1 machine.

这篇关于语句错误信息记录脚本的预期结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆