bat实现打开共享不弹输入用户和密码

rem  这行不能少,要不输入过错误的用户名和密码(或更改密码后)的打不开,找了好久原因,他缓存了该链信息,注意空格,/前

net use \\192.168.255.255\shareName  /del

rem  注意空格,/前有空格,这是建立连接

net use \\192.168.255.255\shareName  "youpassword"  /user:"youUsername"

rem 打开文件夹

start \\192.168.255.255\shareName 

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
下面是一个简单的bat脚本示例,它可以打开IE浏览器,访问指定的网址,并自动填写账号和密码,然后点击登录按钮进行登录。 ```bat @echo off setlocal set "url=https://www.example.com/login" set "username=your_username" set "password=your_password" :: 启动IE浏览器并打开指定网址 start "" iexplore.exe %url% :: 等待浏览器加载完成 timeout /t 5 :: 查找用户名和密码输入框,并输入账号和密码 echo "Filling in login form..." echo "Username: %username%" echo "Password: %password%" echo "------------------------" echo. :: 输入用户名 echo "Entering username..." echo "------------------------" echo. echo ^<input type="text" name="username" id="username"^> > input.txt type input.txt | clip del input.txt start "" cmd /c "echo %username% | clip" timeout /t 1 start "" powershell.exe -Command "$wshell = New-Object -ComObject wscript.shell; $wshell.SendKeys('^v');" timeout /t 1 :: 输入密码 echo "Entering password..." echo "------------------------" echo. echo ^<input type="password" name="password" id="password"^> > input.txt type input.txt | clip del input.txt start "" cmd /c "echo %password% | clip" timeout /t 1 start "" powershell.exe -Command "$wshell = New-Object -ComObject wscript.shell; $wshell.SendKeys('^v');" timeout /t 1 :: 点击登录按钮 echo "Clicking login button..." echo "------------------------" echo. echo ^<input type="submit" value="Login"^> > input.txt type input.txt | clip del input.txt start "" powershell.exe -Command "$wshell = New-Object -ComObject wscript.shell; $wshell.SendKeys('{ENTER}');" timeout /t 1 echo "Login complete." echo "------------------------" echo. endlocal ``` 在上面的示例中,我们使用了一些Windows命令行工具,例如start、timeout、clip和powershell.exe等来自动化执行任务。需要注意的是,这只是一个简单的示例,实际的自动化任务需要根据具体的需求进行编写。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值