Results 1 to 13 of 13

Thread: Restart Pc - Personalize

  1. #1

    Thread Starter
    New Member Mr.Zeus's Avatar
    Join Date
    Feb 2015
    Posts
    9

    Restart Pc - Personalize

    Hi guys!!

    i Try to do open my project... reboot the pc once. And when you return the reboot, open my program without restart the pc. How do you do that?

    Try doing that but always restarts and i don't know separate.


    Thanks a lot, guys!

  2. #2
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,176

    Re: Restart Pc - Personalize

    ????
    Can't understand your problem.
    If you want to run a program (executable) when a PC starts up, you can use the Windows' Task Scheduler.

  3. #3
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Restart Pc - Personalize

    I think he is having a problem where each time is app launches it wants to force a reboot.

    1. The RunOnce registry setting is a fair place to have a app begin with a new restart
    2. If what I interpreted is correct, the app should not be written to try to reboot the system when it launches. If for some reason it needs to reboot the system, a prompt should be provided the user and then shutdown/restart initiated when the user agrees
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  4. #4

    Thread Starter
    New Member Mr.Zeus's Avatar
    Join Date
    Feb 2015
    Posts
    9

    Re: Restart Pc - Personalize

    I think my problem did not understand, sorry for the English but I am very limited with the language. *facepalm*

    I want this, an example:

    When I open my application, the pc restarts only the first time on this computer. After the restart when he returns, open my application and this will not restart the pc.

    (Best I can not describe haha)


    One of my ideas to resolve this: when you run my application, create a .txt to check that the pc will restart. So when my application run again this is not going to restart, when i run it again on this pc.

  5. #5
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Restart Pc - Personalize

    Why do you want the PC to restart the first time they run your app?
    Personally I would not want anything on my computer that forces it to restart.

  6. #6
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Restart Pc - Personalize

    Yep. This would qualify as malware with me.

    Can anyone list some legitmate reasons for applications to reboot the system anymore? It sounds like some attempt to bypass security by injecting things into the boot process, for example a trojan horse or privilege escalation service installation.

  7. #7
    Hyperactive Member
    Join Date
    Oct 2013
    Posts
    389

    Re: Restart Pc - Personalize

    i'll focus on the how not on the why.
    On Form_Load , make it read a registry value or some file for example, that will have a value which will be read at application load ..

    Code:
    'Program loads
    'Check if registry value exists
    'If it does not exist - create it and restart PC
    Private Sub Form_Load()
        Dim appName As String
        appName = App.Title
    
        If (GetSetting(appName, "MySettings", "PC_WAS_RESTARTED") <> "YES") Then
    
            Call SaveSetting(appName, "MySettings", "PC_WAS_RESTARTED", "YES")
            'Restart PC code 
    
        End If
    End Sub

  8. #8

    Thread Starter
    New Member Mr.Zeus's Avatar
    Join Date
    Feb 2015
    Posts
    9

    Re: Restart Pc - Personalize

    Quote Originally Posted by dilettante View Post
    Yep. This would qualify as malware with me.

    Can anyone list some legitmate reasons for applications to reboot the system anymore? It sounds like some attempt to bypass security by injecting things into the boot process, for example a trojan horse or privilege escalation service installation.
    What? is seriously this comment? if I want to malware, I go to a forum malware and fixed. Would not come here to ask for help. Is this logical.
    By the way, is not forced reboot a msgbox will appear. Although necessary for the installation of the software.

    If someone wants to help me without interest, I appreciate it. Otherwise, I will find help by myself. Thanks.

  9. #9

    Thread Starter
    New Member Mr.Zeus's Avatar
    Join Date
    Feb 2015
    Posts
    9

    Re: Restart Pc - Personalize

    Quote Originally Posted by stum View Post
    i'll focus on the how not on the why.
    On Form_Load , make it read a registry value or some file for example, that will have a value which will be read at application load ..

    Code:
    'Program loads
    'Check if registry value exists
    'If it does not exist - create it and restart PC
    Private Sub Form_Load()
        Dim appName As String
        appName = App.Title
    
        If (GetSetting(appName, "MySettings", "PC_WAS_RESTARTED") <> "YES") Then
    
            Call SaveSetting(appName, "MySettings", "PC_WAS_RESTARTED", "YES")
            'Restart PC code 
    
        End If
    End Sub
    Thanks a lot, bro! I'll do a test later, now I don't have much time on the pc. Regards!

  10. #10
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Restart Pc - Personalize

    Thread reported.

  11. #11
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,710

    Re: Restart Pc - Personalize

    One of my programs has a delete on reboot / reboot now? option for files that can't be deleted despite being on an admin account, maybe I should be presumed a malware writer too.. because who knows if I'm deleting a leftover from a game or a critical system file? Or is it only malware if I wanted to notify the user if the files were still there after a reboot despite being marked for deletion.

    I know malware is bad and all but going after someone who asks how to know if the computer has been restarted seems a little overboard. What kind of malware is it you think he is capable of making in VB6 when this issue is such a roadblock he needs help with it? There's probably no need to reboot but I sincerely doubt it's malicious intent.

    bypass security by injecting things into the boot process, for example a trojan horse or privilege escalation service installation.
    Darnit, I wrote this sophisticated boot hijacker to inject my code into system processes, if only I could figure out how to restart the computer and know about it!
    Come on guys.

  12. #12
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    764

    Re: Restart Pc - Personalize

    Yes, it's a serious comment!
    There is no good reason for any "regular" program to be rebooting a user's computer.

    ... Although necessary for the installation of the software ...
    Applications are installed by installers. Use one.
    They're allowed (and, indeed, expected) to behave differently from "regular" programs and can make [almost] any change you like to the machine (changes that users themselves are not allowed to make).

    Even if you only use VB's Package and Deployment Wizard, you'll have far more success (and less Bug Reports and less software returned for refunds) than with your current method.

    Regards, Phill W.

  13. #13
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,902

    Re: Restart Pc - Personalize

    Mr. Zeus, we have no real way of knowing whether you're software would constitute malware or not. However, requiring a reboot the first time a program is run (as opposed to when it is installed) does seem like an unusual requirement and one that could potentially be used for malicious purposes. As you're a fairly new member that is going to raise some reasonable suspicions amongst the existing members. It's not that we're accusing you of writing malware, we just want to be sure that you don't.

    With that in mind I'd ask you to provide a full explanation of why you're executable needs to force a reboot. That way we can know for certain that we're not helping you do anything we shouldn't and it's also quite likely that we can provide you with a better way of going about it.
    The best argument against democracy is a five minute conversation with the average voter - Winston Churchill

    Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width