auto run a bat script in windows 7 at login

后端 未结 3 1732
一向
一向 2020-12-31 09:03

I have recently acquired a windows 7 laptop from my late grandmother. I have been using it for work and other things. I decided to create a VM using VirtualBox And now I wan

相关标签:
3条回答
  • 2020-12-31 09:12

    To run the batch file when the VM user logs in:

    Drag the shortcut--the one that's currently on your desktop--(or the batch file itself) to Start - All Programs - Startup. Now when you login as that user, it will launch the batch file.

    Another way to do the same thing is to save the shortcut or the batch file in %AppData%\Microsoft\Windows\Start Menu\Programs\Startup\.

    As far as getting it to run full screen, it depends a bit what you mean. You can have it launch maximized by editing your batch file like this:

    start "" /max "C:\Program Files\Oracle\VirtualBox\VirtualBox.exe" --comment "VM" --startvm "12dada4d-9cfd-4aa7-8353-20b4e455b3fa"
    

    But if VirtualBox has a truly full-screen mode (where it hides even the taskbar), you'll have to look for a command-line parameter on VirtualBox.exe. I'm not familiar with that product.

    0 讨论(0)
  • 2020-12-31 09:28

    I hit this question looking for how to run batch scripts during user logon on a standalone windows server (workgroup not in domain). I found the answer in using group policy.

    1. gpedit.msc
    2. user configuration->administrative templates->system->logon->run these programs at user logon
    3. add batch scripts.
    4. you can add them using cmd /k mybatchfile.cmd if you want the command window to stay (on desktop) after batch script have finished.
    5. gpupdate - to update the group policy.
    0 讨论(0)
  • 2020-12-31 09:28

    Just enable parsing of the autoexec.bat in the registry, using these instructions.

    :: works only on windows vista and earlier 
    Run REGEDT32.EXE.
    Modify the following value within HKEY_CURRENT_USER: 
    
    Software\Microsoft\Windows NT\CurrentVersion\Winlogon\ParseAutoexec 
    
    1 = autoexec.bat is parsed
    0 = autoexec.bat is not parsed
    
    0 讨论(0)
提交回复
热议问题