mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 00:55:19 +00:00
fix autoruns list for modern windowsen
This commit is contained in:
parent
823f0ce350
commit
c2dbb65982
@ -48,7 +48,6 @@ def list_():
|
||||
'HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Run /reg:64',
|
||||
'HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run'
|
||||
]
|
||||
winver = __grains__['osfullname']
|
||||
for key in keys:
|
||||
autoruns[key] = []
|
||||
cmd = ['reg', 'query', key]
|
||||
@ -57,12 +56,12 @@ def list_():
|
||||
autoruns[key].append(line)
|
||||
|
||||
# Find autoruns in user's startup folder
|
||||
if '7' in winver:
|
||||
user_dir = 'C:\\Users\\'
|
||||
startup_dir = '\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup'
|
||||
else:
|
||||
if os.path.exists('C:\\Documents and Settings\\'):
|
||||
user_dir = 'C:\\Documents and Settings\\'
|
||||
startup_dir = '\\Start Menu\\Programs\\Startup'
|
||||
else:
|
||||
user_dir = 'C:\\Users\\'
|
||||
startup_dir = '\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup'
|
||||
|
||||
for user in os.listdir(user_dir):
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user