某些情况下,比如有一个网站多个账户,需要多开进行操作,那么可以通过下面脚本进行操作。该脚本基于windos10-11环境
环境依赖
1.windows10或windows11系统
2.需要提前安装好谷歌浏览器
基于谷歌浏览器多用户模式创建多开快捷方式
操作
创建文件 谷歌多开.vbs 文件,内容如下
' 随机字符串生成器,用户随机用户生成
Function GetRandStr(length)
Dim desstr, tempstr, i, strlen
tempstr = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
Randomize Time()
strlen= Len(tempstr)
For i = 1 To length
desstr = desstr & Mid(tempstr , Int(Rnd *strlen + 1) ,1)
Next
GetRandStr= desstr
End Function
' 判断google浏览器exe是否存在
Function IsExitAFile(filespec)
Dim fso
Set fso=CreateObject("Scripting.FileSystemObject")
If fso.fileExists(filespec) Then
IsExitAFile=True
Else IsExitAFile=False
End If
End Function
' 谷歌浏览器多用户批量创建
Function createGShort(g_path)
username = GetRandStr(8)
set WshShell = WScript.CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop") '获得桌面目录
set oShellLink = WshShell.CreateShortcut(strDesktop & "\谷歌浏览器多开用户" & username & ".lnk") '快捷方式存放目录及名称
oShellLink.TargetPath = g_path & "\chrome.exe" '指向的可执行文件
oShellLink.Arguments="--user-data-dir=C:\Google1Data\" & username & "\"
oShellLink.WindowStyle = 1 '运行方式(窗体打开的方式)
'oShellLink.Hotkey = "CTRL+SHIFT+F" '快捷键
'oShellLink.IconLocation = "D:\GbServer\img\log.ico, 0" '图标(同样可不指定)
oShellLink.Description = "谷歌浏览器用户" & username '备注信息
oShellLink.WorkingDirectory = g_path '起始目录
oShellLink.Save '保存快捷方式
End Function
Dim GPLIST(1),gpath, gexe
GPLIST(0) = "C:\Program Files (x86)\Google\Chrome\Application"
GPLIST(1) = "C:\Program Files\Google\Chrome\Application"
gexe=1
For i=0 To ubound(GPLIST)
gpath = GPLIST(i)
If IsExitAFile(gpath & "\chrome.exe") Then
Dim name_num
gexe=2
name_num=Inputbox("请输入谷歌浏览器多开用户数量")
Dim Count:Count = 0 '定义一个变量,并赋值为0
For j = 1 To name_num '循环10次
Count = Count + 1
createGShort(gpath)
Next
If name_num <> false then
MsgBox "已经创建好多开快捷方式,请分开登录" '输出10
End If
End If
Next
if gexe=1 then
MsgBox "没有发现google二进制程序,请重新安装谷歌浏览器到默认路径"
end if
双击运行,输入多开的数量,然后点击确定
桌面会多出五个浏览器快捷方式
这些数据存储在 C:\Google1Data 目录下,如果有需要的话,可以在该目录查看用户数据